Question about strtok().

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. 

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
oh that is c++ string
i thought this was the c++ string
char lines[100];
anyway Thanks
char lines[100];

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