Re: GList
- From: Tim MÃller <zen18864 zen co uk>
- To: GTK-app-devel <gtk-app-devel-list gnome org>
- Cc: denis chuvashia ru
- Subject: Re: GList
- Date: Tue, 3 May 2005 14:35:20 +0100
On Monday 02 May 2005 18:13, ÐÐÑÐÐÐÐÑÐÐ ÐÐÐÐÑ wrote:
I think that the result of next code must be 3, but
I have 0. If uncomment "l=..." it's work correctly
GList* l=NULL;
// l=g_list_alloc();
g_list_append(l,GINT_TO_POINTER(1));
g_list_append(l,GINT_TO_POINTER(1));
g_list_append(l,GINT_TO_POINTER(1));
printf("%i",g_list_length(l));
you need to do
l = g_list_append (l, GINT_TO_POINTER(1));
l = g_list_append (l, GINT_TO_POINTER(2));
l = g_list_append (l, GINT_TO_POINTER(3));
Don't use g_list_alloc. You're very unlikely to ever need it.
Cheers
-Tim
- References:
- GList
- From: =?koi8-r?Q?=E7=CF=D2=CF=C4=CE=C9=DE=C5=D7_?= =?koi8-r?Q?=E4=C5=CE=C9=D3?=
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]