O'Reilly logo

C Interfaces and Implementations: Techniques for Creating Reusable Software by David R. Hanson - Princeton University

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Exceptions and Assertions

Three kinds of errors occur in programs: user errors, runtime errors, and exceptions. User errors are expected because they’re likely to occur as the result of erroneous user input. Examples include naming nonexistent files, specifying badly formed numbers in spreadsheets, and presenting source programs with syntax errors to compilers. Programs must plan for and deal with such errors. Usually, functions that must cope with user errors return error codes — the errors are a normal part of the computation.

The checked runtime errors described in previous chapters are at the other end of the error spectrum. They are not user errors. They are never expected and always indicate program bugs. Thus, there is no way ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required