How do I clear the cin buffer in C++?
I would prefer the C++ size constraints over the C versions:
// Ignore to the end of file cin.ignore(std::numeric_limits::max()) // Ignore to the end of line cin.ignore(std::numeric_limits::max(), '\n')