Exceptions
Review Questions
1. |
What is the difference between a compound statement and a simple statement? |
2. |
How can you guarantee that at least one case will be executed for any given switch value? |
3. |
What are the advantages and disadvantages of the three iteration structures? For each, discuss the kinds of situations that would lead you to prefer using it rather than the other two. |
4. |
What happens if a thrown exception is not caught? |
5. |
How can an author of client code know what exceptions need to be handled from a function? |
6. |
How can you catch an unforseen exception? |
7. |
In response to a throw, what happens to the stack? |
8. |
After an exception is handled, how do we return to the location of the tHRow? |
9. |
Why should we always catch objects by reference or pointer? |
10. |
What happens when a destructor throws an exception? |
11. |
What happens when a constructor throws an exception? |
12. |
Which types are preferable for throwing, basic types or object types? Explain the advantages of one over the other. |