With input in the command line:
1 2 3
Which is stored in 'line' my vector is only being populated with
1
What am I doing wrong? Here is the code
string line;
string buffer;
int a,b,base;
cin >> line;
stringstream ss(line);
std::vector<string> tokens;
while( ss >> buffer){
tokens.push_back(buffer);
}
for(int i=0; i<tokens.size(); i++){cout << tokens[i] << endl;}