taking string with spaces c++ code example
Example 1: how to make string get spaces c++
string s;
getline(cin,s);
Example 2: store string with spaces c++
std::string str;
std::getline( std::cin, str);
string s;
getline(cin,s);
std::string str;
std::getline( std::cin, str);