2012-03-29 22:35:27| Category: C + + learning | reporting | font size subscription
(1), set breakpoints where a pause is required
(Method One: Place the mouse on the line where you want to set the breakpoint, press F9 or select Set breakpoints in Debug method Two: Click the left side area of the line of code where you want to set the breakpoint), as shown in the following illustration:
(2), click "Start Debugging" or F5, to debug;
(3), when the program executes to the breakpoint, execution pauses (in break mode), as shown in the following figure:
(4), the value of the variable can be checked at this time
Method One: Hover the mouse pointer over the variable, the value of the variable will be displayed, as shown below the red background of the word, in fact, the mouse is in the middle of the letter R and T, in its lower right side of the display of its value. (This method can just put the mouse on the variable)
Method Two: Place the mouse on a variable, right-click, and "Add Watch" (Add Watch),
The name and value of the variable will be displayed in the generated Watch window
(5), you can choose "progressive" debugging or F11, "step-by-step" debugging or F10, such as continuous press F10, you can see the value of the table changes,
(6), until the end of the program, finish debugging.
Note: In (4), look at the value of the variable, we can also use SHIFT+F9, open the Quick Watch window, and then enter the variable name, view the value of the variable, or open the Quick Watch window, and then fill in the "Watch Window."