1 2 3 4 5 6 7
int choice; while (!(std::cin >> choice)) { std::cout << "Error!\n"; std::cin.clear(); std::cin.sync(); }