Another question on String Function, strtok.
For strtok, here is the explanation, http://www.cplusplus.com/ref/cstring/strtok.html
and my question follows in [b][blue]blue[/b][/blue]
Summerize what they say... is this simply to separate [b]delimiter[/b] from other deliminater...? Then, is using [b]while[/b] the only way to see its result...?
This is the trial code introduced on the site above;
/* strtok example */#include #include
int main ()
char str ="This is a sample string,just testing.";
char * pch;
printf ("Splitting string "%s" in tokens:
pch = strtok (str," ");
while (pch != NULL)
pch = strtok (NULL, " ,.");
Splitting string "This is a sample string,just testing." in tokens:
0 · ·