I have a string array. In this string array for example if i get teststring out it returns me "this is a test string".
with this string its delimited by white spaces. But i am having trouble to delimit them into "this" "is" "a" "test" "string".
i tried using the following codes but char mystring[a] does not accept in the string returned from teststring.
Is there any other better way to delimit the strings in my string array?? please help beeen figuring this for long but cant seem to find a solution...
string a = teststring;
char mystring = a;
char *delim = " "; // only blank
token = strtok(mystring, delim);
while (token !=NULL)
//compare ... (strcmp (token,"and") )
//continue loop if equal
string s = token;
token = strtok(NULL,delim);
cout << "the string token is " << s<<endl;