fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4. using namespace std;
  5. int main() {
  6. string sentence{"Hello how are you."};
  7. stringstream ss{sentence};
  8. string junkWord;
  9. ss >> junkWord;//to get rid of first word
  10. //cout<<sentence.substr(junkWord.length()+1);
  11. ss.ignore(1);
  12. getline(ss,sentence);
  13. cout<< sentence;
  14. }
  15.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
how are you.