The application example for this scenario accepts a date passed from the command line and converts it to a Julian calendar date. The application used in this scenario was built in Creating a Console. If you’d like to create this project to complete the following exercises, do so now.
You have entered a date for conversion, stopped on a breakpoint you’ve set, and used the debug windows to examine some of your program’s variables. You have an idea of what the problem may be, but you’d like to step through the statements of your code to get a better understanding of what’s really happening. The following procedure shows you how to trace through your program’s execution.
To step through your program when in break mode
Tip Choose a line that will be executed before the application ends.
for(int nCount=1; nCount < m_nMonth; nCount++)
A red dot appears in the margin indicating the line on which the breakpoint was set.
The yellow arrow in the margin points to the next instruction to be processed.
In the open debug windows, values for member variables display in red whenever these values change. If you’re following the debugging scenario for a Console application, continue stepping through your application’s source code until the values for m_nDayOfYear
and nCount
change to red in the open debug windows.
For more information about stepping through your program’s code with the debugger, see Stepping Through Code to Trace Execution.
To terminate the debugging session
For more ways to stop a debugging session, see Ending a Debugging Session.
When your program enters break mode, you may want to set another breakpoint or examine one or more Debug Windows to view the values of your program’s member variables.
See Basic Debugging Procedures for additional information on using the features of the integrated debugger.