C++20 sections · 1024 units
Open in CourseQuiz: When to Use Exceptions
Knowledge check
Check Your Understanding
Which scenario is the best use case for exceptions?
- A.Validating user input that might be malformed
- B.Signaling that a constructor failed to initialize an object
- C.Checking if a file exists before opening it
- D.Returning early from a loop when a condition is met