Stringstream c++ while loop
问题 Program finds integeres between commas like "2,33,5" -> 2 33 5. The problem is why is it working if I put for example string like "0,12,4". shouldn't the stringstream put 0 into tmp so the loop was like while(0) at the beginning? vector<int> parseInts(string str) { stringstream ss(str); //getting string vector<int> result; char ch; int tmp; while(ss >> tmp) { //while(IS IT INTEGER ALREADY OR NOT?) result.push_back(tmp); ss >> ch; } return result; 回答1: shouldn't the stringstream put 0 into tmp