Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GList *ref = NULL;
- GList *item = NULL;
- char *hstnm[] = {"ch0108", "ch0916", "ch1724",
- "ch2532", "ch3340", "ch4148",
- "ch4956", "ch5764", "ch6572",
- "ch7380", "ch8188", "ch8996"};
- for(gint p = 0; p < 12; p++)
- ref = g_list_prepend(ref, hstnm[p]);
- // find within the list one of the strings
- g_print("Item to find: %s n" , hstnm[2]);
- item = g_list_find(ref, hstnm[2] );
- if(item != NULL)
- g_print("Item: %s n" , (gchar *)item->data);
Add Comment
Please, Sign In to add comment