A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/cpp_standard_library/cpp_ios_fail.htm below:

C++ IOS Library - fail

C++ IOS Library - fail Description

It is used to check whether either failbit or badbit is set. At least one of these flags is set when an error occurs during an input operation.failbit is generally set by an operation when the error is related to the internal logic of the operation itself; further operations on the stream may be possible. While badbit is generally set when the error involves the loss of integrity of the stream, which is likely to persist even if a different operation is attempted on the stream. badbit can be checked independently by calling member function bad −

iostate value

(member constants)

indicates functions to check state flags good() eof() fail() bad() rdstate() goodbit No errors (zero value iostate) true false false false goodbit eofbit End-of-File reached on input operation false true false false eofbit failbit Logical error on i/o operation false false true false failbit badbit Read/writing error on i/o operation false false true true badbit Declaration

Following is the declaration for ios::fail function.

bool fail() const;
Parameters

none

Return Value

true if badbit and/or failbit are set or else false otherwise.

Exceptions

Strong guarantee − if an exception is thrown, there are no changes in the stream.

Data Races

Accesses the stream object.

Concurrent access to the same stream object may cause data races.

ios.htm


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4