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.
A flawed program
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, ...