 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Therefore,
try blocks establish when exception handling is
|
|
in
effect.
|
|
| • |
If
an exception is thrown outside of a try block, terminate
|
|
|
is
called.
|
|
| • |
When
we are in a try block, we are able to select and
|
|
|
handle
different types of exceptions. This is called
|
|
|
catching
an exception.
|
|
| • |
The
following demonstrates a try block that "turns on"
|
|
|
exception
handling for our entire program:
|
|
int
main() {
|
|
try {
|
|
... //program code
|
|
}
|
|
... //code to handle exceptions
|
|
cout <<"normal program
exit" <<endl;
|
|
return(0); }
|
|