Problem with GSList (GLib)
问题 HI, I'm trying to use GSList from glib.h but I'm having problems when filling the list with char * elements. Here's the code: GSList * res = NULL; char * nombre; while (...) { nombre = sqlite3_column_text(resultado, 1); res = g_slist_append (res, nombre); } printf("number of elements: %i\n", g_slist_length(res)); printf("last element: %s\n", g_slist_last(res)->data); When I print the number of elemnts, I see the list is not empty. But when I print the last element, It doesn't show anything...