Advertisement
Mazamin

Strtok example

Jan 15th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <string.h>
  2. #include <stdio.h>
  3.  
  4. main(){
  5.     char string[] = "Helo world, this is a test";
  6.     char del[] = " ,";
  7.     char * word;
  8.  
  9.     word=strtok(string, del);
  10.  
  11.     while(word!=NULL){
  12.         printf("%s\n", word);
  13.         word=strtok(NULL, del);
  14.     }
  15.    
  16.     return(0);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement