get a text and split it by spaces in c++ code example
Example 1: how to make string get spaces c++
string s;
getline(cin,s);
Example 2: c++ split string by several space
std::string s = "split on whitespace ";
std::vector<std::string> result;
std::istringstream iss(s);
for(std::string s; iss >> s; )
result.push_back(s);