Значение cin.fail () в C ++?
while (!correct)
{
cout < "Please enter an angle value => ";
cin >> value; //request user to input a value
if(cin.fail()) // LINE 7
{
cin.clear(); // LINE 9
while(cin.get() != '\n'); // LINE 10
textcolor(WHITE);
cout < "Please enter a valid value. "< endl;
correct = false;
}
else
{
cin.ignore(); // LINE 18
correct =true;
}
}