Error – Handling with Exceptions

In this final chapter, we will learn how to perform error handling while system programming. Specifically, three different methods will be presented. The first method will demonstrate how to use POSIX-style error handling, while the second method will demonstrate how to use the standard C-style set jump exceptions. The third method will demonstrate how to use C++ exceptions, and the pros and cons of each approach will be discussed. Finally, this chapter will conclude with an example that demonstrates how C++ exceptions outperform POSIX-style error handling.

In this chapter, we will cover the following topics:

  • POSIX-style error handling
  • Exception support in C++
  • An example with Exception Benchmark

Get Hands-On System 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.