Question 20
Back to Exercise
What does in.exceptions(std::ios::failbit | std::ios::badbit); do?
- A Disables errors
- B Makes the stream throw std::ios_base::failure whenever failbit or badbit becomes set Correct
- C Prints errors
- D Opens the file in binary
Correct Answer: Option B
Be careful: reaching the end of file with a read also sets failbit, so the final failing read of a loop would throw too.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!