You are viewing a single comment's thread. Return to all comments →
vector parseInts(string str) { // Complete this function vector integers; stringstream stream (str); int a; char ch; while (true) { stream >> a; integers.push_back(a);
if (!(stream >> ch)) { break; } } return integers;
}
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 →
vector parseInts(string str) { // Complete this function vector integers; stringstream stream (str); int a; char ch; while (true) { stream >> a; integers.push_back(a);
}