1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple...
-
Upload
eric-mosley -
Category
Documents
-
view
213 -
download
0
Transcript of 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple...
![Page 1: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/1.jpg)
1
Getting Started with C++
![Page 2: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/2.jpg)
2
Objective
You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008
![Page 3: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/3.jpg)
3
Start Up Visual Studio 2008Click
![Page 4: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/4.jpg)
4
Visual Studio Projects
A project in Visual Studio is a container for all of the files needed to compile, execute, and debug a program.
A solution can consist of multiple related projects.
Our solutions will only have a single project. So a solution and a project will be essentially
equivalent in this course.
![Page 5: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/5.jpg)
5
Ready to Create a Project
![Page 6: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/6.jpg)
6
Creating a C++ Project in Visual Studio 2008
![Page 7: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/7.jpg)
7
Creating a C++ Project in Visual Studio 2008
Click
![Page 8: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/8.jpg)
8
Creating a C++ Project in Visual Studio 2008
Click
![Page 9: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/9.jpg)
9
Start with an Empty Project
Click
Click
![Page 10: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/10.jpg)
10
We Have a Project
![Page 11: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/11.jpg)
11
Adding a Source File to the Project
![Page 12: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/12.jpg)
12
Adding a Source File to the Project
Click
![Page 13: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/13.jpg)
13
It's Open in the Editor
![Page 14: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/14.jpg)
14
Add the Program Code
![Page 15: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/15.jpg)
15
View the Solution Explorer
![Page 16: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/16.jpg)
16
Solution Explorer Window
![Page 17: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/17.jpg)
17
Compile and Link the Program
![Page 18: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/18.jpg)
18
Run the Program
Click here to run
![Page 19: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/19.jpg)
19
Program "hello.cpp" in Action
Press "Enter" to end program and close window.
![Page 20: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/20.jpg)
20
Running Without the IDE
We can double click here to run the program independently of the IDE.
Here is the exe file.
![Page 21: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/21.jpg)
Running from the Desktop
Drag the hello.exe icon to the desktop.
Double click the icon to run the program from the desktop.
21
![Page 22: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/22.jpg)
22
Running Without the IDE
We can also run the program from the DOS command line.
Copy the exe file into a convenient directory (e.g. C )
Open a command window cd to the directory Type the command: hello
![Page 23: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/23.jpg)
23
Running from the Command Line
![Page 24: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/24.jpg)
24
Deploying the Program
The file hello.exe contains everything that is needed to execute the program.
To deploy the program to another Windows computer, just copy the file into a convenient folder.
Users can run the program from the command line, or can double click the file in the folder. Or can put a shortcut to the file on the desktop.
![Page 25: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/25.jpg)
25
Creating a Shortcut
![Page 26: 1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.](https://reader035.fdocuments.in/reader035/viewer/2022070403/56649f325503460f94c4d6d4/html5/thumbnails/26.jpg)
26
Running by Double Clicking
Move the shortcut to the desktop.
Now you can run the program by double clicking the icon.