1#include <string.h>
2#include <stdio.h>
3
4int main () {
5 char str[80] = "This is - www.tutorialspoint.com - website";
6 const char s[2] = "-";
7 char *token;
8
9 /* get the first token */
10 token = strtok(str, s);
11
12 /* walk through other tokens */
13 while( token != NULL ) {
14 printf( " %s\n", token );
15
16 token = strtok(NULL, s);
17 }
18
19 return(0);
20}