views:

31

answers:

1

Hello, I have an array of string, like:

char **strings = {"str1", "str2"};

And i would like to know if there is a function in the glib to find the position of a string in this array.

I guess i could just do g_strcmp0 in a for() loop, but there may be a better way to do it.

Thanks

A: 

The function you want does not exist, so you'll have to do it in a for-loop. If you used a GList instead of an array, then you could use g_list_index().

ptomato