Creating Your First Program in Microsoft Visual C++



Microsoft Visual C++ is an Integrated Development Environment (IDE) for the C/C++ programming language that is installed on the computers in Brown Hall. If you wish to install it on your own personal computer, you can get it from the website http://www.microsoft.com/express/vc/.   This document describes the version “Visual Studio Enterprise 2015”.  Start Microsoft Visual Studio.  This will bring up the main window as shown below.






Select the menu item File -> New -> Project.  Under the “Templates” menu on the left, select “Visual C++” and “Win32” as shown below.  Also, select “Win32 Console Application Visual C++”, which is the simplest type of application.



At the bottom, enter a location that you can save the files to, such as your home directory on “adit”.  Enter a name for the project such as “myprog1”.

After clicking “Ok”, it will bring up the window below:





Click on “Next” to go to the next screen:

Select the buttons for “Console application” and “Empty project”, and click on Finish. Back on the main window, go to the right box where your project files are displayed and right-click on
the folder called “Source Files”.  Choose Add -> New Item …to get to a pop-up window as shown below.






Select type “C++ File (.cpp)” and type a name for the file, such as “main”.  Then click on Add.

This will bring up the editor, where you can type in the code for the program.  Type in the code as shown below:


Then choose Debug -> Start Debugging.  This will compile and run the program. 

Congratulations!  You have run your first program using Microsoft Visual C++.  For a good tutorial on

C++, see:http://www.learncpp.com.  (I’m sure there are lots of other good tutorials out there … let me know if there is the one you particularly like.)


Click for Download PDF

Post a Comment

Previous Post Next Post