Load Visual C++ 2005
Start by loading the Visual C++ IDE. You can also see how to do this with Visual C++ or Turbo C++ Explorer.From the File menu, click New and select Project. Select Win 32 on the Project Types tree. In the name box, enter example1. You can change the location to wherever you want to store the examples. It defaults to a folder within Documents and Settings. This folder holds the source code and project files. If you want a new directory leave the Create directory for solution checkbox ticked.
Click OK. You will now see the Win 32 Application Wizard. You can press Finish or click Next to see the Application Settings. For example 1 we can keep the default settings.
Now type in a couple of lines so you end up with this. Press Ctrl + s (ie Hold the ctrl key down and press the s key) and this will save the file. You can also click File, Save example1.cpp or click the single floppy disk image just below and between the View and Project menu commands.
// example1.cpp : main project file.Press the F7 and this will compile. Before you run it, click the line
#include "stdafx.h"
#include <iostream>
using namespace std;
int main(void)
{
cout << "Hello World";
return 0;
}
return 0;and press the F9 Key. You can run it by pressing F5. It will open a console window and output "Hello World". Press F5 and it will continue running and exit. Without the Break Point, it would just open the Windows, print Hello World and then close too fast to notice.
We'll use these same settings for all the future lessons in the C++ tutorials so make a note of them.
On the next page : A line by line breakdown of Example 1.


