StringStream

Sort by

recency

|

543 Discussions

|

  • + 0 comments

    int main() { string val; cin>>val; int a=val.size(); for(int i{0};i

    return 0;
    

    }

  • + 0 comments
    vector<int> parseInts(string str) {
        char ch;
        int next_int;
        stringstream ss(str);
        vector<int> integers = vector<int>();
        
        ss >> next_int;
        integers.push_back(next_int);
        
        while (ss >> ch) {
            ss >> next_int;
            integers.push_back(next_int);
        }
        
        return integers;
    }
    
  • + 0 comments
    vector<int> parseInts(string str) {
        vector<int> v;
        stringstream ss(str);
        string temp;
        while (getline(ss, temp, ',')){
            v.push_back(stoi(temp));
        }
        return v;
    }
    
  • + 0 comments

    vector parseInts(string str) { // Complete this function stringstream ss(str); int a; char ch; vector local; while(ss>>a){ local.push_back(a); ss>>ch; } return local; }

  • + 0 comments

    I have not seen this type of coding till now, it is a very good coding. If you want to make your profile name stylish, then you can name style with the help of NickPicker to give an elegant look to any name.