fork(1) download
  1. #include <stdio.h>
  2. #include <string>
  3. #include <string.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string str="This||a||sample||string|";
  9.  
  10. string a;
  11.  
  12. str=strtok ((char *)str.c_str(),"|");
  13.  
  14. while (str.c_str() != NULL)
  15. {
  16. printf ("str:%s\n",str.c_str());
  17.  
  18. str = strtok (NULL, "|");
  19.  
  20. }
  21.  
  22. return 0;
  23. }
Runtime error #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
Standard output is empty