I\'ve noticed that whenever I write a program that uses std::cin
that if I want the user to press Enter to end the program, I have to write std::cin.ignor
Discl: I'm simplifying what really happens.
The first serves to purge what the extraction operator (>>) hasn't consumed. The second waits for another \n.
It is exactly the same when we do a std::getline after an extraction: a the_stream::ignore(std::numeric_limits
is required before the call to std::getline()