Chapter 10 Programming Pitfalls

In C, as in every language, it's rare for any program to work perfectly the first time. An important part of knowing a language is recognizing what not to do and why certain problems occur.

This chapter describes common C programming pitfalls and how to avoid them. It is organized under broad topics, such as “Pointer Problems,” with a category for miscellaneous problems at the end. The description of each error gives a code example, explains why the error occurs, and offers a solution.