Re: g_list_append - cannot convert error



on 10/17/01 12:53 PM, Havoc Pennington at hp redhat com wrote:

In C++ a cast is required here, something like:

    g_list_append (glist, static_cast<void*>("String"))

In C you don't need that.

The issue is the const, not the void* vs. char*, and static_cast won't
remove const, so it needs to be:

    g_list_append (glist, const_cast<char*>("String"));

The conversion from char* to void* is done automatically.

    -- Darin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]