Re: Simple way to list keys & values of a GHashTable object?
- From: "Frederick C. Lee" <frederick_lee apple com>
- To: Tadej Borovšak <tadeboro gmail com>
- Cc: gtk-list gnome org
- Subject: Re: Simple way to list keys & values of a GHashTable object?
- Date: Wed, 10 Nov 2010 16:02:47 -0800
I'll study it.
Thank You!
Ric.
On Nov 10, 2010, at 2:53 PM, Tadej Borovšak wrote:
> 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]