© Giulio Zambon 2016

Giulio Zambon, Practical C, 10.1007/978-1-4842-1769-6_5

5. Exception Handling

Giulio Zambon

(1)Harrison, Aust Capital Terr, Australia

When talking about why computer programs fail, many people distinguish between user errors and developer/programmer errors (i.e., bugs). But such a distinction is, in my opinion, ill defined. For example, suppose that a program requires the users to type a date into an input field, somebody enters a negative number as day of the month, and the program crashes. It is true that the user made a mistake, but the program should have been able to recognize and cope with such input error. Where do you draw the line?

Clearly, it is not possible for a developer to write code that can cope with every possible ...

Get Practical 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.