#include
using namespace std;
#include<string.h>
int main()
{
char s[100]= “Today is a rainy day”;
char *ptr=strtok(s," ");
cout<<ptr<<endl;
while(ptr!=NULL)
{
ptr=strtok(NULL," ");
cout<<ptr<<endl;
}
return 0;
}
In the given code, ptr is a pointer than how when we print ptr without dereferencing, it gives string.