fork(1) download
  1. #include <string>
  2. #include <iostream>
  3. #include <sstream>
  4. using namespace std;
  5.  
  6. string fSplit(const string& fString)
  7. {
  8. string word;
  9. istringstream buf(fString);
  10. buf >> word;
  11. return word;
  12. }
  13.  
  14. int main()
  15. {
  16. cout << fSplit("One two three four") << '\n';
  17. }
Success #stdin #stdout 0.02s 2860KB
stdin
Standard input is empty
stdout
One