SyntaxFix
Write A Post
Hire A Developer
Questions
Use the std::getline() from <string>.
std::getline()
<string>
istream & getline(istream & is,std::string& str)
So, for your case it would be:
std::getline(read,x);