Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
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 · ·