StringStream

  • + 0 comments

    include

    include

    include

    using namespace std;

    vector parseInts(string str) { stringstream ss(str); char ch; int a; vector result; int count = 1; for(int i =0; i < str.length(); i ++) { if (str[i] == ',') { count++; } }

    for(int i =0; i <count; i ++)
    {
        ss >> a >> ch ;        
        result.push_back(a);
    }
    
    return result;
    

    }