#include <string.h>
#include <stdio.h>
int main()
{
const char str[80] = "This, is, \\n, www.tutorialspoint.com, \\n, website";
const char s[2] = ", ";
char *token;
int count = 0;
/* get the first token */
token = strtok(str, s);
/* walk through other tokens */
while( token != NULL )
{
printf( " %s\n", token );
count++;
token = strtok(NULL, s);
}
printf("Token count is %d\n",count);
return(0);
}