R
Rudra Banerjee
Hello friends,
I encountered a C code(not by me, obviously) which uses:
gchar *key, *val, **kiter;
gint i;
char *keys[] = {"id", "type", "author", "year",NULL};
g_hash_table_iter_init (&iter, table);
while (g_hash_table_iter_next (&iter, (void **)&key, (void **)&val))
{
for (kiter = keys, i = 0; *kiter; kiter++, i++)
{
...
}
}
where gchar, gint, g_hash_table are from glib.
The point is, from my understanding, for loop has the syntax:
for(i=initial; i=final; increment)
So, can anyone kindly help me understand what is two initial condition and two increment condition doing here?
(The code is working fine, with out any error with gcc; I just want to understand it)
I encountered a C code(not by me, obviously) which uses:
gchar *key, *val, **kiter;
gint i;
char *keys[] = {"id", "type", "author", "year",NULL};
g_hash_table_iter_init (&iter, table);
while (g_hash_table_iter_next (&iter, (void **)&key, (void **)&val))
{
for (kiter = keys, i = 0; *kiter; kiter++, i++)
{
...
}
}
where gchar, gint, g_hash_table are from glib.
The point is, from my understanding, for loop has the syntax:
for(i=initial; i=final; increment)
So, can anyone kindly help me understand what is two initial condition and two increment condition doing here?
(The code is working fine, with out any error with gcc; I just want to understand it)