How can you protect an integer defined input variable from a accidental keyboard charter input when using cin to read the keyboard? An accidental charter input seems to disable the cin or scanf function. The cin or scanf places 255 into the assigned int variable and then cin or scanf stop excepting input.
int number;
cin >> number;
If you type any char [ a-z A-Z ] on the keyboard cin will put 255 in the int variable number and then the cin stops excepting input until you stop and restart the program.
Does anyone know how to protect your program form this type of problem?