#include <string.h> int main () { char str[] ="This is a sample string"; char *p; p=strtok(str," "); while (p!= NULL) { cout<<p; p=strtok(NULL," "); } return 0; }