fork(12) download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <iterator>
  4. #include <sstream>
  5. #include <string>
  6. #include <vector>
  7.  
  8. using namespace std;
  9.  
  10. int main() {
  11. const auto str = "The quick \tbrown \nfox"s;
  12.  
  13. istringstream is{ str };
  14.  
  15. const vector<string> tokens{ istream_iterator<string>(is), istream_iterator<string>() };
  16.  
  17. copy(cbegin(tokens), cend(tokens), ostream_iterator<string>(cout, "\n"));
  18. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
The
quick
brown
fox