fork 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(fString) >> word;
  10. return word;
  11. }
  12.  
  13. int main()
  14. {
  15. cout << fSplit("One two three four") << '\n';
  16. }
  17.  
Success #stdin #stdout 0s 3064KB
stdin
Standard input is empty
stdout
One