cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
About cin.fail()
About cin.fail()
Aug 28, 2015 at 7:04pm UTC
amidaraxar
(19)
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 UTC
AbstractionAnon
(6954)
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 UTC
Cubbi
(4774)
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 UTC
LB
(13399)
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.