About cin.fail()

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
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/

cppreference has a summary of all conditions that set those bits:
http://en.cppreference.com/w/cpp/io/ios_base/iostate#The_failbit
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.