fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void){
  5. char message[] = "Einstein, 1900 $$$ Mozart, 1700 $$$ Michi, 1982 $$$ John, 1940";
  6. char seps[5] = "$$$";
  7. char *token = strtok(message, " ");
  8. printf(" %s ", token);
  9.  
  10. while ((token = strtok(NULL, seps)) != NULL){
  11. printf("%s \n", token);
  12. }
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
 Einstein, 1900  
 Mozart, 1700  
 Michi, 1982  
 John, 1940