StringStream

  • + 15 comments

    I am new to stringstream. I just copied this code from submission.

    Can anyone please explain me, what is happening here? Thanks in advance :)

    vector<int> parseInts(string str) {
    stringstream ss(str);   //??
    vector<int> result;
    char ch;
    int tmp;
    while(ss >> tmp) {      //??
        result.push_back(tmp);
        ss >> ch;           //??
    }
    return result;