Question about strtok().

Feb 22, 2016 at 12:09am
Can someone tell me why doesnt strtok() accept a string variable?
I cannot use c++ string in this project. So, how do i go about tokenize the string?
1
2
3
 string lines;
 getline(inFile, lines);
 char *token = strtok(lines, "/0"); // this is where i have the problem. 

Feb 22, 2016 at 12:15am
I cannot use c++ string in this project. So, how do i go about tokenize the string?
ehh Im confused, you're literally using c++ string in the code you've shown.

See if this helps -
http://stackoverflow.com/questions/266357/tokenizing-strings-in-c
Last edited on Feb 22, 2016 at 12:17am
Feb 22, 2016 at 12:18am
oh that is c++ string
i thought this was the c++ string
char lines[100];
anyway Thanks
Feb 22, 2016 at 12:19am
char lines[100];

This is C-string. What you're using is c++ string.
Topic archived. No new replies allowed.