#include<iostream>
#include<string.h>
using namespace std;
int main ()
{
char sentence []= "this is a sentence with 7 tokens";
cout <<"this string to be tokenized is "<<endl<<sentence<<endl;
char *tokenp=strtok(sentence," ");
while (tokenp)
{
cout <<tokenp<<endl;
tokenp=strtok(NULL," ");
//cout <<sentence<<endl;
}
cout <<"after strtok sentence ="<<sentence<<endl;
return 0;
}
