17.1 Introduction

As you know from Section 7.10, an exception is an indication of a problem that occurs during a program’s execution. Exception handling enables you to create applications that can handle (i.e., resolve) exceptions and perform appropriate cleanup when an exception that cannot or should not be handled occurs. In many cases, this allows a program to continue executing as if no problem had been encountered. The features presented in this chapter enable you to write robust, fault-tolerant programs that can deal with problems and continue executing or terminate gracefully.

Previously, we’ve shown how to handle and how to indicate exceptions (Chapters 7 and 9, respectively). We begin this chapter with a review of these exception-handling ...

Get C++ How to Program, 10/e 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.