About cin.fail()

Aug 28, 2015 at 7:04pm
Hello guys, I have a question: how does it works cin.fail() and how it can be used as a condition ? I'd like to control the input from the keyboard.
Thanks to everyone in advance
Aug 28, 2015 at 7:45pm
cin.fail() is simply a bool function that returns true if either the fail state bit or the bad state bit is set.
http://www.cplusplus.com/reference/ios/ios/fail/

Aug 28, 2015 at 9:13pm
cppreference has a summary of all conditions that set those bits:
http://en.cppreference.com/w/cpp/io/ios_base/iostate#The_failbit
Aug 29, 2015 at 1:52am
amidaraxar wrote:
I'd like to control the input from the keyboard.
Consider reading: http://www.LB-Stuff.com/user-input
Topic archived. No new replies allowed.