You are on page 1of 13

Setting up C++ Express

File  New  Project

1
At Project types, select Win 32

Templates: Visual Studio Installed templates, select


At
Win32 Console Application

Enter Name, Location, Solution Name according to your choice.

Click OK

2
Select Application Settings

Click Next button

3
At Application type: radio button, check Console Application

At Additonal option: box, check Empty project

Click Finish button

4
5
Right click at Resoure File

At the pull down menu, select ADD and then selecto Existing Item

6
Here is my source code
C:\Greg\VCExpress2008\DeitelExamples\Examples_HTProg_CExpressC2008\ch02

You can put your source code anywhere you like, of course.

Click Add button

7
Now observe that Resource Files C++ Welcome.cpp is added to this project.

8
Right click at C++ Welcome.cpp and you will see the source code.

9
To run Debug  Start Without Debugging

Click Yes (ie. This program is not built earlier )

10
The End

Note: The following is the code we just ran.

// Fig. 2.5: Welcome.cpp


// Text-printing program.
#include <iostream> // allows program to output data to the screen

// function main begins program execution

11
int main()
{
std::cout << "Welcome to Visual C++!\n"; // display message

return 0; // indicate that program ended successfully

} // end function main

12
Tired off typing std::cout?
If so,use this: ….”using namespace std”
// Text-printing program.
#include <iostream> // allows program to output data to the screen

using namespace std; //added this Greg Lee

// function main begins program execution


int main()
{
//std::cout << "Welcome to Visual C++!\n"; // commented out Greg Lee
cout << "Welcome to Visual C++!\n"; // addeed Greg Lee
return 0; // indicate that program ended successfully

} // end function main

13