Guest User

Untitled

a guest
Jul 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. GList *ref = NULL;
  2. GList *item = NULL;
  3.  
  4. char *hstnm[] = {"ch0108", "ch0916", "ch1724",
  5. "ch2532", "ch3340", "ch4148",
  6. "ch4956", "ch5764", "ch6572",
  7. "ch7380", "ch8188", "ch8996"};
  8.  
  9. for(gint p = 0; p < 12; p++)
  10. ref = g_list_prepend(ref, hstnm[p]);
  11.  
  12. // find within the list one of the strings
  13. g_print("Item to find: %s n" , hstnm[2]);
  14. item = g_list_find(ref, hstnm[2] );
  15. if(item != NULL)
  16. g_print("Item: %s n" , (gchar *)item->data);
Add Comment
Please, Sign In to add comment