我有像
这样的字符数组 char *a[]={"hi","hello","how are you"};
我想将其转换为CStringArray
我该怎么做?
答案 0 :(得分:2)
char *a[] = { "hi","hello","how are you" };
CStringArray array;
for (int i = 0; i < sizeof(a) / sizeof(a[0]); i++)
{
array.Add(a[i]);
}
sizeof(a) / sizeof(a[0])
是a
数组中字符串文字的数量,即3。