fork download
  1. #include <iostream>
  2. #include <sstream>
  3.  
  4.  
  5. int main() {
  6. std::istringstream stream("Two words");
  7. std::string word;
  8. stream >> word;
  9. std::cout << word << std::endl;
  10. std::cout << stream.rdbuf() << std::endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Two
 words