Visual Studio .NET 2003 C++ Tutorial

Welcome to CSCI 195.  This tutorial guides you through the process of creating a simple C++ console application using Visual Studio .NET 2003.  A version of this tutorial is also available for Visual C++ 6.0

Step 1: Creating a New Project

Using Windows Explorer create a folder to hold all of your projects for this class.  In this example I have named mine C:\PROJ.  You can name your folder anything you like.  Once you have created your folder close Windows Explorer.

 

Start Microsoft Visual Studio .NET 2003 using the Start button from Windows.  This is how it looks on my system:

010.jpg (73815 bytes)


Once you have started Visual Studio you should see a screen similar to the the following image:

020.jpg (134513 bytes)

 

Click the menu item File | New | Project... or press CTRL+SHIFT+N or click the New Project button.

A dialog box is displayed.  

The screen should look like this:

040.jpg (49481 bytes)

 

Click the OK button to continue.  You should see the following window:

050.jpg (59455 bytes)

 

Click Application Settings on the left side of the window and then place a check in the box marked Empty project.  The screen should look like this:

060.jpg (49802 bytes)

 

Click the Finish button to create the empty project that looks like this:

070.jpg (125536 bytes)

 

Step 2: Typing your Program Code

Click the menu item Project | Add New Item... or press CTRL + SHIFT + A or click the Add New Item button.

075.jpg (126076 bytes)

 

Select  C++ File (.cpp) from the list on the right and type the name hello in the text box labeled Name:

085.jpg (52096 bytes)

 

Click the Open button to enter the edit mode.  You should see the following screen:

087.jpg (106075 bytes)

 

Enter the following program:

Once you have typed the program in the edit window, your screen should look like this:

090.jpg (135713 bytes)

 

Save your program by clicking on the icon that looks like a floppy disk (4th icon from the left).

 

Step 3: Executing Your Program

To execute your program click the menu item Debug | Start Without Debugging or press CTRL + F5.

100.jpg (143824 bytes)

The following message box will appear:

110.jpg (17284 bytes)

 

Click the Yes button to compile your program. If you receive any error messages recheck you program code and make sure it appears exactly as shown above.  If your code has no errors it will compile and execute.  You should eventually see the following screen:

120.jpg (20491 bytes)

 

Type your name when prompted and then press Enter.  You should see the following screen.

130.jpg (26566 bytes)

 

Once you recover from the awe of creating your first C++ program you can press any key to make the console window disappear.

 

That's it!  You've created your first C++ project.

 

 

 

 

Hit Counter