Chapter 11: Handling Exceptions

This chapter will begin our quest to expand your C++ programming repertoire beyond OOP concepts, with the goal of enabling you to write more robust and extensible code. We will begin this endeavor by exploring exception handling in C++. Adding language-prescribed methods in our code to handle errors will allow us to achieve less buggy and more reliable programs. By using the formal exception handling mechanisms built into the language, we can achieve uniform handling of errors, which leads to more easily maintainable code.

In this chapter, we will cover the following main topics:

  • Understanding exception handling basics—try, throw, and catch
  • Exploring exception handling mechanics—trying code that may raise exceptions, ...

Get Demystified Object-Oriented Programming with C++ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.