开发者

adding string object to gArray

开发者 https://www.devze.com 2023-02-19 23:59 出处:网络
I want to add some string objects in GArray. But when i read the API manual of g_array_new(), it seeks the size of the element to be added while creating开发者_开发百科 the array, but

I want to add some string objects in GArray. But when i read the API manual of

g_array_new(), it seeks the size of the element to be added while creating开发者_开发百科 the array, but

different string objects have different length, so how can i cope with this issue.

Regards, iSight


What you need is GPtrArray, not GArray.


I believe, the size of the element is:

sizeof(gchar*)

You put into array not the actual string, but the pointer to a string.

0

精彩评论

暂无评论...
验证码 换一张
取 消