You are viewing a single comment's thread. Return to all comments →
vector<int> arr; stringstream newString(str); int n = 0; int size = str.size(); for (int i = 0; i < size; i++) { if (str[i] == ',') { n++; } } for (int i = 0; i <= n; i++) { char ch; int a; newString >> a >> ch; arr.push_back(a); } return arr;
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 →