I am supposed to get an input line that can be in of any of the following formats:
#include #include int main () { char str[] ="word1 word2,word3"; char* pch; printf ("Splitting string \"%s\" into tokens:\n",str); pch = strtok(str," ,"); while (pch != NULL) { printf ("%s\n",pch); pch = strtok (NULL, " ,.-"); } return 0; }