|
-
June 12th, 2002, 10:22 PM
#1
string
Hi!
I have a code here which is uncompleted one, what i want to do is actually to store each string that is "two" and "three" in an array of strings so that i can use them separately later on. But i'm not sure how to do it. I can only separate them using strtok but no idea how to store them. Can somebody help me pls. Thanks!
char string[]={"two;three;"};
char *tokenPtr;
tokenPtr=strtok(string,";");
while (tokenPtr != NULL)
{
cout<<tokenPtr<<endl;
tokenPtr=strtok(NULL, ";");
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|