how to store a string with a space in it c++ code example Example: store string with spaces c++ std::string str; std::getline( std::cin, str);