Chapter 20
Debugging Your Programs, Part 3
In This Chapter
Debugging using the built-in debugger
Building your application with debugger information
Setting a breakpoint
Single-stepping your program
Fixing a sample problem
I introduce a few techniques for finding errors at the end of Parts II (Chapter 8) and III (Chapter 13). Here, near the end of Part IV, I want to touch on debugging techniques one final time.
In this chapter, I introduce you to the debugging tools built into the Code::Blocks development environment (similar tools exist for most other environments). Learning to use the debugger will give you clear insight into what your program is doing (and what it’s not doing, at times).
A New Approach to Debugging
Chapters 8 and 13 demonstrated how to find problems by adding output statements in key positions. Outputting key variables lets you see what intermediate values your program is calculating and what path it’s taking through your C++ code.
However, the output technique ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access