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 you specify a base-class type as the type of a catch handler, then throw objects of derived-class types?

  11. 17.11 Suppose a catch handler with a precise match to an exception object type is available. Under what circumstances might a different handler be executed for exception objects of that type?

  12. 17.12 Must throwing an exception cause program termination?

  13. 17.13 What happens when a catch handler throws an exception?

  14. 17.14 What does the statement throw; do?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset