glib slist question




I've never worked too in depth with void pointers, so this problem is
baffling me.

here's a little (hypothetical) code snippet that illustrates what i'm
trying to do - add an array of strings to a GSList.

GSList *list = NULL;
gchar *append[] { "one","two","three","four" };

list = g_slist_append(list, append);

This works fine, but how would I go about dereferencing, say, element
2 of the array I just inserted?

I've tried list->data[2] with various casts, but whatever I do I get a
compiler error.

Thanks for any help.
Sorry if this is off topic.
j




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