I\'m trying to do a simple task of reading space separated numbers from console into a vector, but I\'m not getting how to do this properly.
vector
Use a getline combined with an istringstream to extract the numbers.
getline
istringstream
std::string input; getline(cin, input); std::istringstream iss(input); int temp; while(iss >> temp) { yourvector.push_back(temp); }