Getting Started in Visual C++

This page will guide you through creating a Visual C++ console project from
scratch. An easier way is to use one of the Visual C++
Project Makers to automate this process.
There is a different set of instructions depending on which Visual Studio
compiler you use. (To determine which compiler you have, run the compiler
and then choose About from the Help menu.) Choose one of the
following options.
Visual Studio.NET
Visual Studio Express
Edition
You can download the free Visual Studio
C++ Express Edition at
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
Visual Studio 6

1. Launch the Program
Then close all windows and dialog boxes
within the Visual Studio main window.
2. Create a Project
 | From the File menu, choose New,
then Project. Under Project Types, expand the tree view to
Visual C++ Project -> Win32, then choose the template for Win32
Console Project. Give it a name and a location. Click OK. |
 | In the Win32 Application Wizard, select Application Settings.
Choose Empty Project and then click the Finish button. |
3. Open a C++ Code Window
 | From the View menu, choose
Solution Explorer, then right-click the name of your project in the tree
view. Select Add -> Add New Item. Under Categories,
expand the tree view to Visual C++ -> Code, then choose the template
for C++ file (.cpp). |
 | Choose a name such as main.cpp,
and then click the Open button. |
4. Programming
 | Type your program into the large, blank
window. You may close the other windows. |
 | When your program is entered, from the
Debug menu choose Start Without Debugging. If asked
whether you want to build, choose yes. |
 | Any errors will be indicated in the bottom
output window. Click on the first error message to go to the error.
(You may have to scroll up in the output window to find the first error
message.) |
//A program in C++ to demonstrate console-window output
#include <iostream> //Library for input and output
using namespace std; //Working in standard namespace int main()
{
cout << "Hello World" << endl;
return 0;
}
5. When You Are Done

Getting Started with Visual
Studio Express
You can download the free Visual Studio C++ Express Edition
at
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
After
the program is installed, here is how to get started.
1.
Launch the Program
2. Create a Project
From the File menu, choose New, then
Project. Under Project Types, expand the tree view to Visual C++ ->
General, then choose the template for Empty Project. Give it a
name and a location. Click OK.
3. Open a C++ Code Window
From the Project menu, choose Add New Item
Under Catagories, expand the tree view to Visual C++ -> Code, then
choose the template for C++ File(.cpp) Give it a name (and a new
location if desired). Click Add.
4. Programming
 |
Type your program (see example below) into the large,
blank window. You may close the other windows. |
 |
When your program is entered, from the Debug menu
choose Start Without Debugging. If asked whether you want to build,
choose yes. |
 |
Any errors will be indicated in the bottom output
window. Click on the first error message to go to the error. (You may have
to scroll up in the output window to find the first error message.) |
//A program in C++ to demonstrate
console-window output
#include <iostream> //Library for
input and output
using namespace std; //Working in
standard namespace
int main()
{
cout << "Hello World" << endl;
return 0;
}
5. When You Are Done
 | Get back into your program at another time by clicking
the .sln file in the folder. |
 | If you don't see your code window, then go to the menu
View -> Solution Explorer. Expand the tree until you see your .cpp
file and click on it. |
 | If there is a folder called Debug or Release
in your project folder, you can safely throw it away. This will save
enormously on disk space. |

1. Launch Visual Studio 6.0
2. Create a Project
 | From the File menu, choose New.
Select the Project tab. |
 | From the choices on the left, choose
Win32 Console Application. |
 | Type a name into the Project Name space. This will be the
name of the folder containing your files. |
 | Select the button after the Location
text box to choose a place to store your project folder |
 | If a dialog box pops up, select Empty
Project, then click the Finish button. |
3. Open a C++ Code Window
 | From the File menu, choose New.
Select the Files tab. |
 | From the choices on the left, choose
C++ Source File. |
 | Give the file a name such as main.cpp. |
4. Programming
 | Type your program into the large, blank
window. You may close the other windows. |
 | When your program is entered, from the
Build menu choose Execute. |
 | Any errors will be indicated in the bottom
output window. Click on the message to go to the error.
(You may have to scroll up in the output window.) |
//A program in C++ to demonstrate console-window output
include <iostream> //Library for input and output
using namespace std; //Working in standard namespace int main()
{
cout << "Hello World" << endl;
return 0;
}
5. When You Are Done
 |
Throw away the Debug
folder to save enormously on disk space. |
 |
Get back into your
program at another time by clicking the
.dsw
file in the folder. |
|