In the following code :
#include #include #include using namespace std; int main() { string x = \"This
Use the std::getline() from <string>.
<string>
istream & getline(istream & is,std::string& str)
So, for your case it would be:
std::getline(read,x);