fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. std::string parseMe = "This is a test, string";
  8. std::stringstream parser(parseMe);
  9. std::string token;
  10.  
  11. while (std::getline(parser, token, ' '))
  12. {
  13. std::cout << token << "\n";
  14. }
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
This
is




a
test,
string