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 a 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 Deciphering Object-Oriented Programming with 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.