c programming lecture 3 : c introduction
TRANSCRIPT
![Page 1: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/1.jpg)
C Programming Lecture 3 : C Introduction
1 Lecture notes : courtesy of Woo Kyun and Chang Byung-Mo
![Page 2: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/2.jpg)
C Programming Language
Designed by Dennis Ritchie (1972) used for developing UNIX OS
C features Structured programming , modular programming Highly portable Efficient (fast) C has the features of high level language and low
level language
2
Dennis Ritchie
![Page 3: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/3.jpg)
simple C program (hello.c)
3
output: Hello, World !
![Page 4: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/4.jpg)
C compiler
compiler? Programmer can use high level language such as C CPU knows machine language (assembly language)
C compiler Commercial compiler: Microsoft Visual C/C++ (ver. 6.0) Free compiler: gcc
4
Compiler C program
int main…
Machine language 010101…
![Page 5: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/5.jpg)
Visual Studio 6.0
Microsoft Visual C++ 6.0 Project window Editing window Message window
5
![Page 6: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/6.jpg)
Program Development
1. Creating Project 2. Adding Files 3. Editing Program 4. Compile&Build 5. Execution&Debugging
6
![Page 7: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/7.jpg)
Creating a Project (1/5)
1. File New
Projects tab
Win32 Console Application
2. Location
3. Project Name
4. OK
5. Finish & OK
7
![Page 8: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/8.jpg)
Creating a Project (2/5)
1. File New
2. Location
Folder selection
3. Project Name
4. OK
5. Finish & OK
8
![Page 9: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/9.jpg)
Creating a Project (3/5)
1. File New
2. Location
3. Project Name
Hello
4. OK
5. Finish & OK
9
![Page 10: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/10.jpg)
Creating a Project (4/5)
1. File New
Win32 Console Application
2. Location
3. Project Name
4. OK
5. Finish & OK
10
![Page 11: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/11.jpg)
Creating a Project (5/5)
Hello project is created
11
![Page 12: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/12.jpg)
Adding Files (1/3)
1. File New
Files tab
C++ Source File
2. filename
3. OK
12
![Page 13: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/13.jpg)
Adding Files (2/3)
1. File New
2. filename
Add to project
hello.c
3. OK
13
![Page 14: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/14.jpg)
Adding Files (3/3)
Source file hello.c is added to Hello project
14
![Page 15: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/15.jpg)
File Edit
15
![Page 16: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/16.jpg)
Visual Studio 2008 : Creating Command-Line Program
![Page 17: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/17.jpg)
Visual Studio 2008 Creating Command-Line Program
![Page 18: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/18.jpg)
Visual Studio 2008 Creating Command-Line Program
![Page 19: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/19.jpg)
Visual Studio 2008 Creating Command-Line Program
![Page 20: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/20.jpg)
Visual Studio 2008 Creating Command-Line Program
![Page 21: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/21.jpg)
Compile & Build
compile Compile hello.c
Object file (.obj) is created
Build Build Hello.exe
Link : link object files and create a executable file (.exe)
21
![Page 22: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/22.jpg)
Compile-time error
Grammar error. Object file can not be created Double click error message line
22
![Page 23: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/23.jpg)
Programming Process
23
Source files (.c)
temporary program texts
Object files
Executable file (.exe)
preprocessor
compiler
linker
library files
![Page 24: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/24.jpg)
gcc / g++
Free C/C++ compiler developed by GNU
24
![Page 25: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/25.jpg)
Turbo C
Free C/C++ compiler developed by Borland
25
![Page 26: C Programming Lecture 3 : C Introduction](https://reader030.vdocuments.us/reader030/viewer/2022020707/61fe5f304df8882f15322e33/html5/thumbnails/26.jpg)
Mobile C
There are some applications for Android or iOS based platforms
Free C/C++ application for Android: Mobile C
26