4
读取输入后,为什么还要调用cin.clear()和cin.ignore()?
Google Code University的C ++教程曾经有以下代码: // Description: Illustrate the use of cin to get input // and how to recover from errors. #include <iostream> using namespace std; int main() { int input_var = 0; // Enter the do while loop and stay there until either // a non-numeric is entered, or …