1#include<stdio.h>
2#include <string.h>
3
4int main() {
5 char string[50] = "Hello! We are learning about strtok";
6 // Extract the first token
7 char * token = strtok(string, " ");
8 // loop through the string to extract all other tokens
9 while( token != NULL ) {
10 printf( " %s\n", token ); //printing each token
11 token = strtok(NULL, " ");
12 }
13 return 0;
14}