Both are same. fail
is a typical function where is ‘!’ is an overloaded operator. You may want to check reference http://www.cplusplus.com/reference/ios/ios/fail/ before posting.
1
solved What’s the difference between cin.fail() and !cin in C++?
Both are same. fail
is a typical function where is ‘!’ is an overloaded operator. You may want to check reference http://www.cplusplus.com/reference/ios/ios/fail/ before posting.
1
solved What’s the difference between cin.fail() and !cin in C++?