CS210 Lab: Introduction to Visual C++
Postlab Answers

Postlab Answers:

The following are the postlab questions and answers.
  1. What is the function of each of following Visual C++ icons?
    1. Compiles--Same as: Build | Compile   from the main menu. Compiles the source file and forms the object file for it. It does not perform a link, so it is useful only for quickly compiling a file to check for errors.

    2. Builds--Same as: Build | Build projectname   from the main menu. Compiles all of the source files in the project that have been modified since the last build, and then links them to create an executable.

    3. Sets a Breakpoint for debugging. Accessed by right clicking the mouse and selecting "Insert/Remove Breakpoint" from the pop-up menu. A red dot will appear in the gray bar to the left of the line of code to indicate the breakpoint has been set.

    4. Start command, which starts the debugger--Same as: Debug | Start   from the main menu. The Start command executes code from the current location until it reaches a breakpoint, the end of the program, or a point at which the program pauses to get input from the user

    5. Step Into (for debugging). When Step Into is chosen, the debugger executes each C++ statement one by one. Pausing to let the programmer check the values of variables or make adjustments between statements. Step Into lets the programmer step into every function call, loop, or other code block in the program. In essence, no statement will be executed until the programmer is ready to execute it.

    6. Step Out (for debugging). Step Out is used in conjunction with Step Into. It will immediately execute the remaining code in the current function call, loop, or other code block, then pause execution. The programmer can continue to debug the program

    7. Step Over (for debugging). This command is used to step through a program without stepping into function calls. When Step Over is used on a function call, loop, or other code block, the entire block is executed immediately.

    8. Execute or run the program (without debugging information). This is the same as choosing Debug | ! Start Without Debugging   from the main menu.

  2. When debugging and using the watch windows, how do you view the values in an array? For instance, in the following diagram, how do you view the values within the "Values" array?

Back to Postlab questions click here
Back to the Introduction to Visual C++ Lab click here

CS Dept Home Page
CS Dept Class Files
CS210 Class Files

Copyright: Department of Computer Science, University of Regina.