You are viewing a single comment's thread. Return to all comments →
vector parseInts(string str) { vector vec; stringstream ss; ss << str; char ch; int num; while (!ss.eof()){ ss >> num >> ch; vec.push_back(num); } return vec; }
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) { vector vec; stringstream ss; ss << str; char ch; int num; while (!ss.eof()){ ss >> num >> ch; vec.push_back(num); } return vec; }