You are viewing a single comment's thread. Return to all comments →
What about this?
vector<int> parseInts(string str) { vector<int> ret; string temp; for(int i = 0; i<str.size(); i++){ if (str[i]==','){ ret.push_back(stoi(temp)); temp.clear(); } else{ temp.push_back(str[i]); } if (i == str.size()-1){ ret.push_back(stoi(temp)); temp.clear(); } } return ret; }
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 →
What about this?