There's a program where we are supposed to enter numbers via a while loop, and I want to quit the program by entering a "non-numerical" character. Could this be the code?
while (cin.fail())
{
// block of code
}
Also, is there a special standard header for cin.fail()
?