Re: Simple way to list keys & values of a GHashTable object?
- From: Tadej Borovšak <tadeboro gmail com>
- To: "Frederick C. Lee" <frederick_lee apple com>
- Cc: gtk-list gnome org
- Subject: Re: Simple way to list keys & values of a GHashTable object?
- Date: Wed, 10 Nov 2010 23:53:57 +0100
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 gmail com
tadej borovsak gmail com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]