cin >> str; // this just stores whats before the proceding white space.
/*
error: No user-defined-conversion operator available
that can perform this conversion, or the operator
cannot be called
*/
cin.getline(str, sizeof(std::string), '\n');
How can you use cin.getline() with std::string data type?
Hi. As I was reading, I came across this question: how can you use cin.getline() with a std::string data type?
Thanks,
dxfoo
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement