SUMMARY
  • Exception is a condition which leads to run time errors.
  • Synchronous exception gets generated while our program is running. They are generated because of our program. A typical example is dividing by zero.
  • Non-synchronous exception – Events like power failure are considered non-synchronous. Programmers have no control over them.
  • Catch block – It catches and processes the exception.
  • If the exception-parameter is an ellipsis (…), the catch clause handles any type of exception. Such a handler must be the last handler for its try-block.
  • try block – A block prefaced with keyword try. This block can throw an exception.
  • throw is a C++ keyword It is used to throw an exception.
  • An uncaught exception invokes function terminate().
  • set_terminate() ...

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.