#include <string> std::string str; std::getline(std::cin, str); // The output of std::getline(std::cin, str) will be stored in str.