© Will Briggs 2019Will BriggsC++ for Lazy Programmershttps://doi.org/10.1007/978-1-4842-5187-4_9
9. Using the Debugger
Lynchburg, VA, USA
The debugger lets you step through the program, line by line or function by function, seeing the values of variables so you can tell what goes wrong. Good idea, right?
I think so.
To cover useful debugger commands, let’s use the debugger to repair the flawed program in Example 9-1. It’s intended to draw a US flag: a sort of a groovy, hand-made looking version with hollow stars as in the picture. (To do a better job, we’d use an image from a file – but for now I want to use, and debug, ...