Is there any way in C++ to detect an input stream failure without any action taken by the user and to clear it automatically? I'm noticing in some of the programs i write, many users acidentally enter a number into a char variable or letter in to an int variable, which causes a input stream failure.



slick