CHAPTER 15

image

Runtime Errors and Exceptions

EXCEPTIONS are used to signal errors or unexpected conditions in a program. Using exceptions to signal errors is not mandatory, and you’ll sometimes find it more convenient to handle them in other ways. However, it is important to understand how exceptions work, because they can arise out of the use of standard language features such as the new operator and the dynamic_cast operator and exceptions are used extensively within the standard library.

In this chapter you’ll learn:

  • What an exception is and when you should use exceptions
  • How you use exceptions to signal error conditions
  • How you handle exceptions ...

Get Beginning C++ 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.