no matching function to call for “getline”

What your teacher said is not true. cin will not “break”. It’s just that formatted extraction into an std::string is designed to read word by word. That’s intentional. It’s not broken.

As for your error, your call to std::getline is broken because the delimiter argument has the wrong type. '\n' is a char literal; "\n" is a char array literal, not at all what you wanted.

Leave a Comment