get rest of a stringstream c 2b 2b

Solutions on MaxInterview for get rest of a stringstream c 2b 2b by the best coders in the world

showing results for - "get rest of a stringstream c 2b 2b"
Juan Manuel
20 Oct 2017
1#include <iostream>
2#include <sstream>
3
4using namespace std;
5
6int main() {
7        stringstream ss("abc gg rrr ff");
8        string s1, s2;
9        ss >> s1;
10        getline(ss, s2); //get rest of the string!
11        cout << s1 << endl;
12        cout << s2 << endl;
13        return 0;
14}
15