C++中将字符串转换为字符串数组,该如何解决

C++中将字符串转换为字符串数组比如CStringi see dead peole,将其转换为s[0]is[1]sees[2]deads[3]p

C++中将字符串转换为字符串数组
比如CString='i see dead peole',将其转换为
s[0]=i
s[1]=see
s[2]=dead
s[3]=people

[解决办法]
完蛋..

代码写错了..!

----


CString str = "Hello World";
CString ptr[100];
int i = 0;

while(TRUE)
{
int index = str.Find(' ');

if (index == -1)
{
ptr[i] = str;
break;
}

ptr[i] = str.Left(index);
str = str.Right(str.GetLength() - index - 1);
i++;
}