Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Program Development with Microsoft Visual C++

in Programing on March 26, 2015

Introduction
This tutorial is written to help those who are new to Visual C++. It introduces the Integrated
Development Environment (IDE) of Microsoft Visual C++ 2010 and shows how to enter, edit, save,
retrieve, compile, link, and run a C++ program in such an environment. It also shows a simple way
to print the source code and the program output.
Two simple C++ projects, one single-file and the other multi-file are used as demo programs so that
students can focus on Visual C++ 2010 IDE instead of getting distracted by language features. For
the convenience of the reader, source code for both programs is listed in the Appendix.
If you have any comments and/or suggestions that might help improve the effectiveness of this
tutorial, please forward them to either Dr. E. Hu at hue@wpunj.edu or Marvin Kiss at
kissm@wpunj.edu.
Single-file Project: The Hello World Program
Step 1: Launch the MS Visual C/C++ 2010 software from task bar
Step 2: In the menu bar, click File àNew à Projects…to display the New Project dialog box
shown below:
In the New dialog box shown below, select by clicking Visual C++ in the Installed Template
pane and Win32 Console Application in the middle pane. You then enter a name of your
choice for the project (e.g., hello world as shown) in the Name box, select the location or folder
in which you’d like to store project files (e.g., C:UsersirwinhuDocumentsCS230 as shown)
by clicking the Browse… Note that there is no need to enter a name in the Solution name box;
the system fills the project name in it by default.
Click on the OK button to display the Win32 Application Wizard – hello world window shown
Click the Next button to display the following dialog box:
Check the Empty project box as shown above and click on the Finish button to proceed to the
next step.
Step 3: Now the system displays the following window.
Select C++ Files (.cpp) by clicking on it in the middle pane and enter an arbitrary file name (e.g.,
hello world, the same name we used for the project is chosen here). Click Add to proceed to the
next step.
Step 4: The system displays the below window. Notice that 1) the Source Folder in Solution
Explorer pane (make sure the Solution Explorer instead of Class View tab is selected) contains
the hello world.cpp file that we just added and 2) the blank editing area/board is displayed with a
hello world.cpp tab for you to enter your C++ source code.
Step 5: To compile, link, load, and execute a program in a single step, click Debug in the menu
bar and the click Start Without Debugging. If there is no error in your project, the below
message ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
is displayed in the Output window as shown below.
Step 6: You are normally required to turn in both the source code and the program output in
printed form. One way to do it is to copy the source code from Visual C++ 2010 and paste it
onto a Word document. Immediately after the source code, do a screen capture of the program
output window (click on the window to activate it, hold down the Alt key and press the Print
Screen key) and paste it on the Word document as shown below.
Step 6: You are normally required to turn in both the source code and the program output in
printed form. One way to do it is to copy the source code from Visual C++ 2010 and paste it
onto a Word document. Immediately after the source code, do a screen capture of the program
output window (click on the window to activate it, hold down the Alt key and press the Print
Screen key) and paste it on the Word document as shown below.

Categories: Programing