Setting up C++ Express
File New Project
1
At Project types, select Win 32
Templates: Visual Studio Installed templates, select Win32 Console Application At
Enter Name, Location, Solution Name according to your choice.
Click
OK
2
Select Application Settings Click Next button
3
At
Application type:
At
Additonal option: box,
Click
radio button, check check
Console Application
Empty project
Finish button
4
5
Right click at
Resoure File
At the pull down menu, select
ADD
and then selecto
6
Existing Item
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
Click
Debug
Start Without Debugging
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 // 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 // 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