Self-Review Exercises

  1. 17.1 List five common examples of exceptions.

  2. 17.2 Give several reasons why exception-handling techniques should not be used for conventional program control.

  3. 17.3 Why are exceptions appropriate for dealing with errors produced by library functions?

  4. 17.4 What’s a “resource leak”?

  5. 17.5 If no exceptions are thrown in a try block, where does control proceed to after the try block completes execution?

  6. 17.6 What happens if an exception is thrown outside a try block?

  7. 17.7 Give a key advantage and a key disadvantage of using catch(...).

  8. 17.8 What happens if no catch handler matches the type of a thrown object?

  9. 17.9 What happens if several handlers match the type of the thrown object?

  10. 17.10 Why would ...

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.