Re: CList memory management with C++ ...



I was under the impression that the append function only looked at the 1st n
array elems, where n is controled by the number of columns specified in the
gtk_clist_new function... I have been writing code passing non-null terminated
arrays to gtk_clist_append w/o problems... Is this a new specification as of
1.2.8 or 2.0? ...I am currently using 1.2.6 b/c of several company policies
currently in place, but anticipate a shift over to newer versions of gtk in the
near future.

-John

Havoc Pennington wrote:
It makes a copy - your code should be fine, except the array is
nul-terminated:

do something like:

char *ptr[2] = { NULL, NULL };
ptr[0] = i->c_str ();

Havoc

-- 
---------------------------
John Schmerge
schmerge cyber com




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