EXERCISES
  1. What is an exception? How is an exception handled in C++?
  2. 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.
  3. Is it possible to recover from an error using catch block? Give reasons.
  4. What is the use of catch block with ellipsis as parameter?
  5. Why catch clause with ellipsis is always the last catch clause?
  6. Can a function specify what exception it may throw? What will happen if exception of some different type eventually gets thrown?
  7. What do you understand by the term “stack unwinding”?
  8. Why throw statement is always a part of an “if statement”?
  9. What happens when an exception is thrown from outside the try block?
  10. 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.