fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char Array[16][20];
  6. char texto[] = "This is my text example";
  7. char *pch;
  8. int i = 0;
  9.  
  10. pch = strtok(texto," ");
  11.  
  12. while (pch != NULL){
  13. strcpy(Array[i++], pch);
  14. pch = strtok (NULL, " ");
  15. }
  16. for(int n = i, i = 0; i < n; ++i )
  17. puts(Array[i]);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
This
is
my
text
example