www.gibmonks.com

Main Page




Previous Page
Next Page

[Page 838 (continued)]

Self-Review Exercises

16.1

List five common examples of exceptions.

16.2

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

16.3

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

16.4

What is a "resource leak"?

16.5

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

16.6

What happens if an exception is thrown outside a TRy block?

16.7

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

16.8

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

16.9

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

16.10

Why would a programmer specify a base-class type as the type of a catch handler, then throw objects of derived-class types?

16.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?

16.12

Must throwing an exception cause program termination?

16.13

What happens when a catch handler throws an exception?

16.14

What does the statement throw; do?

16.15

How does the programmer restrict the exception types that a function can throw?

16.16

What happens if a function throws an exception of a type not allowed by the exception specification for the function?

16.17

What happens to the automatic objects that have been constructed in a TRy block when that block tHRows an exception?


Previous Page
Next Page