How to Create a C++ Project in Visual Studio

57
rate or flag this page

By nicomp

Introduction

This tutorial illustrates the steps for creating a new C++ project in Visual Studio. The process is consistent in Visual Studio 2003, Visual Studio 2005, and Visual Studio 2008. The screens vary somewhat, but this tutorial generally applies to all three versions of Visual Studio. Entry level versions of Visual Studio software can be downloaded at no charge from Microsoft.com; look for the Express editions.

Open Visual Studio and Click File / New / Project.

Step 02

Select Project Type C++
Select Template Empty Project
Type in a descriptive name for the project
Click OK

Step 02
Step 02

Step 03

Open the Solution Explorer (On The Main Menu: View / Solution Explorer)
Alternate-click (right-click) on The Source Files folder
Select Add / New Item

Step 03
Step 03

Step 04

Under Category, select Code
Under Template, select C++ File

Type in a descriptive name for the file. Use main.cpp if the file will contain the main function. Otherwise, use a name that describes the contents of the file. C++ source code files should end in .cpp and header files should end in .h

Click Add

Step 04
Step 04

Step 05

Create your documentation header (Flower Box).

Step 05
Step 05

Step 06

Create a source code file for the function (or class) and a header file for the function (or class). Your Solution Explorer should look like this.

Step 06
Step 06

Step 07

To runĀ  your project, click Debug / Start Without Debugging. Visual Studio will compile, link, and execute for you.

Step 07
Step 07

Suggested References

C++ Primer Plus (5th Edition) C++ Primer Plus (5th Edition)
Price: $33.00
List Price: $59.99
The C++ Programming Language: Special Edition The C++ Programming Language: Special Edition
Price: $47.95
List Price: $84.99
working