Chapter 20

Debugging Your Programs, Part 3

In This Chapter

arrow Debugging using the built-in debugger

arrow Building your application with debugger information

arrow Setting a breakpoint

arrow Single-stepping your program

arrow 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 ...

Get Beginning Programming with C++ For Dummies, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.