read spaces in a string c++ code example
Example 1: how to make string get spaces c++
string s;
getline(cin,s);
Example 2: c++ remove space from string
static std::string removeSpaces(std::string str)
{
str.erase(remove(str.begin(), str.end(), ' '), str.end());
return str;
}