Using the Autos window
. Start the debugger by selecting Debug > Start
. When execution halts at the breakpoint at line 14, open the Autos
window (Fig. L.28
) by selecting Debug > Windows > Autos
. The Autos
window allows you to view the contents of the variables used in the last statement that was executed. This allows you to verify that the previous statement executed correctly. The Autos
window also lists the values in the next statement to be executed. Notice that the Autos
window lists the account1
variable, its value and its type. Viewing the values stored in an object lets you verify that your program is manipulating these variables correctly. Notice that account1
contains a large negative value. This value, which may be different each time the program executes, is account1
's uninitialized value. This unpredictable (and often undesirable) value demonstrates why it is important to initialize all C++ variables before use.
Figure L.28. Autos window displaying the state of account1 object.
(This item is displayed on page 1378 in the print version)