My program contains a simple input code:
int number;
std::cin >> number;
Of course, if user types 3.14, only "3" will be read. That's ok for the further code in general, but I want that kind of input to be marked as invalid and prompt user to try again with a proper integer.
Is there a way to check if anything was typed after the int?