// Extract the first token char * token = strtok(string, " "); // loop through the string to extract all other tokens while( token != NULL ) { printf( " %s ", token ); //printing each token token = strtok(NULL, " "); } return 0;