Chapter 15. Bulletproofing Programs with Assertions and Exceptions

  • Examine error-handling strategies

  • Learn to handle programming andl runtime errors

  • Discover how assertion macros canp help you detect programming errors

  • Learn to handle anomalous situations with exception handling


Devising Error Handling Strategies

Like it or not, bugs crop up in programs. An elusive bug can cause errors to occur that crash the program—or worse, the user’s computer. You can usually categorize an error as a programming error or as a runtime error that’s beyond the programmer’s control. To prevent catastrophe, you should use error-handling mechanisms to help detect programming errors in your source code and to deal with runtime errors, too.

Handling ...

Get Practical C++ now with O’Reilly online learning.

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