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 ma开发者_运维技巧y be a better way to do it.
Thanks
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()
.
精彩评论