#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[100] = “All i want is burger, static, pluto and beer”;
char *ptr = strtok(s," ");
cout<<ptr<<endl;
//ptr always points the first word before
//the word all is then stored in an array like a,l,l,/0(null)
ptr =strtok(NULL," ");//this prints till i
cout<<ptr<<endl;
// so in order to put this words in order it should be in a loop
while(ptr!=NULL)//this starts from want
{
ptr =strtok(NULL," ");
cout<<ptr<<endl;
}
cout<<endl;
char *ptr1 =strtok(s,",");
cout<<ptr1<<endl;
while(ptr1!=NULL)
{
ptr1 =strtok(NULL,",");
cout<<ptr1<<endl;
}
}