You are viewing a single comment's thread. Return to all comments →
We can also "peek" at the top of the stream and "ignore" if we find a comma, PSB:
stringstream ss(str); int a; vector<int> vec; while (ss >> a){ vec.push_back(a); if (ss.peek() == ','){ ss.ignore(); } } return vec;
I hope this helps!
Regards!
Seems like cookies are disabled on this browser, please enable them to open this website
StringStream
You are viewing a single comment's thread. Return to all comments →
We can also "peek" at the top of the stream and "ignore" if we find a comma, PSB:
I hope this helps!
Regards!