The istream bad is a flag that is set on the istream when an input operation fails. It is a member of the standard library for C++, and is defined in the library.
In this example, we read a character from the standard input (cin) and check if the bad flag is set on the stream object. If it is, we print an error message to the standard error (cerr) stream.
In this example, we read a whole line of text from the standard input and store it in a string object. We check if the istream is bad after the getline operation, and print an error message if it is.
Package library:
C++ (Cpp) Istream::bad - 1 examples found. These are the top rated real world C++ (Cpp) examples of Istream::bad extracted from open source projects. You can rate examples to help us improve the quality of examples.