Skip to content

Latest commit

 

History

History
5 lines (4 loc) · 419 Bytes

8.3.md

File metadata and controls

5 lines (4 loc) · 419 Bytes

The condition of a stream is equivalent to !fail(), which means set either failbit or badbit will terminate the loop. For example, errors list below will terminate the loop:

  • System-level failure. (Set the badbit) Such as an unrecoverable r/w error.
  • Recoverable error. (Set the failbit) Such as reading a character when numeric data expected.
  • Reaching end-of-file. (Set both the eofbit and failbit)