EXERCISES
- What is an exception? How is an exception handled in C++?
- Can we place two or more catch blocks together to catch and handle multiple types of exceptions thrown by a try block? If your answer is yes, describe the syntax.
- Is it possible to recover from an error using catch block? Give reasons.
- What is the use of catch block with ellipsis as parameter?
- Why catch clause with ellipsis is always the last catch clause?
- Can a function specify what exception it may throw? What will happen if exception of some different type eventually gets thrown?
- What do you understand by the term “stack unwinding”?
- Why throw statement is always a part of an “if statement”?
- What happens when an exception is thrown from outside the try block?
- Write a program ...
Get Object Oriented Programming with C++, Second Edition 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.