Loop until integer input is in required range fails to work with non-digit character inputs
The problem is that: cin >> input; Will cause the bad bit to be set when you try and read a non numeric value. After that happens any attempt to use the operator>> is silently ignored. So the way to correct for this is to test if the stream is in a good state and … Read more