i think that the result of next code must be 3. but i have 0
...because l is still NULL, and g_list_length(NULL) is 0. g_list_append returns the address of the first item in the list with its appended item, so you should use:
if uncomment "l=..." it's work correctly
#include <glib.h>
int main() { GList* l=NULL; // l=g_list_alloc();
l = g_list_append(l,GINT_TO_POINTER(1)); l = g_list_append(l,GINT_TO_POINTER(1)); l = g_list_append(l,GINT_TO_POINTER(1));
printf("%i",g_list_length(l)); }
_______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list