Download presentation
Presentation is loading. Please wait.
Published byCatherine May Modified over 8 years ago
1
Tutorial 1 Writing Your First C++ Program CSC1110C Introduction to Computer Programming By Paul Pun Acknowledgement: Special thanks to Dr. Michael Fung and Szeto for sharing their well-prepared PowerPoint
2
Outline What is an IDE? Microsoft Visual Studio 2003 Dev-C++ Getting familiar with MS Visual Studio Writing your first C++ program Compilation Execution Common Errors
3
What is an IDE? Integrated Development Environment Usually includes: Editor – where you type in your code Compiler – translates C++ code to executable format Debugger – helps you to locate program errors e.g. Microsoft Visual Studio, Dev-C++
4
Microsoft Visual Studio Includes Visual C++/C#/Basic…etc. We will only use Visual C++ MS VS2003 available at EE department You can download from http://msdn70.e-academy.com/hk_025401/ Check your EE email accounts for login ID and password
5
Dev-C++ Free download at http://www.bloodshed.net/dev/devcpp.html Complete IDE with editor, compiler and debugger Please refer to online documentation for installation and use of this product
6
Your first program - Helloworld //This program do nothing except saying hello #include using namespace std; int main() { cout << "Hello, world!" << endl; return 0; }
7
Launching Visual Studio 2003
8
Overview Debug and build output View classes, source files here Manage projects, and edit source file Click to open new Project or … …Click here
9
Creating C/C++ Win32 Console project
10
Application Settings
11
Adding a New Item – Method 1
12
Adding a New Item – Method 2 Click to activate Solution Explorer
13
Add New C/C++ Source File Item
14
Type in Program HelloWorld.cpp
15
Start Compile/ Build/ Debug [F5]
16
Start Without Debugging [Ctrl-F5]
17
Compile/ Build Successful
18
Hello World! [Ctrl-F5] Press any key to close console window
19
Common Errors (1) 1) This dialog indicate errors in our code 2) Check here for error and line number 3) Missing semicolon!
20
Common Errors (2) 2) Missing double quote! 1) Check here for error and line number
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.