17. Debugging Programs

This chapter teaches you two techniques you can use to debug your programs. One involves using the preprocessor to allow for the conditional inclusion of debugging statements in your program. The other technique involves the use of an interactive debugger. In this chapter, you are introduced to a popular debugger called gdb. Even if you use a different debugger (such as dbx, or one built in to an IDE tool), it is likely that your debugger will have similarities to gdb.

Again, as discussed in the opening of Chapter 14, “Working with Larger Programs,” some of the topics covered in this chapter may not seem applicable to you depending on the operating system and development environment you use, but the concepts are important ...

Get Programming in C, Fourth Edition 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.