jeudi 24 novembre 2016

Use of >> operator

Can anyone Please explain me the meaning of the following line in the code

 while (ss >> temp)

    std::string str = "123:234:56:91";   

    for (int i=0; i<str.length(); i++)
    {
        if (str[i] == ':')
           str[i] = ' ';
    }

    vector<int> array;
    stringstream ss(str);
    int temp;
    while (ss >> temp)
       array.push_back(temp); 

Aucun commentaire:

Enregistrer un commentaire