Re: Simple way to list keys & values of a GHashTable object?

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

 



Hi.

For simple printout, you may be interested in g_hash_table_foreach().
Something like this should dump key-value pairs to console (I assumed
here that both key and value are strings):

===
static void
dump_pair (const char *key,
           const char *value)
{
  g_print ("Key: %s Value: %s\n", key, value);
}

...

g_hash_table_foreach (table, (GHFunc)dump_pair, NULL);
===

Cheers,
Tadej

-- 
Tadej BorovÅak
tadeboro.blogspot.com
tadeboro@xxxxxxxxx
tadej.borovsak@xxxxxxxxx
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list



[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux