Programming language - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Programming language

Description:

Introduction to C Programming language ... – PowerPoint PPT presentation

Number of Views:133
Avg rating:3.0/5.0
Slides: 16
Provided by: suwi6
Category:

less

Transcript and Presenter's Notes

Title: Programming language


1
Introduction to C
2
Programming language
  • ??????????? ??? ??????????????????????????????????
    ??????????????????????????????????????
  • ???????????????????????? ???????????????????
    (machine language) ??????????????????? 2
  • ??????????????, ???????????, ????????????
  • ??????????????????? - ????????????????????????????
    ?????????????????????????????????????????
    ??????????????????????????????????????????? (????
    Compiler, Interpreter)

3
C Programming
  • ?????????????????????????????????????????????
  • ????????????????????? ????????
  • ??? text editor ????? source code
    ???????????????????????????????
  • ?? source file ??????????????????? compile ??????
    C compiler
  • ???????????????????????? source code ??? compile
    ????????????????????????????
  • ???????????????? object file (????????????????????
    ??)

4
  • ?? object file ?? link ??? library ???????
    (?????????????????????????????????????????????????
    ??????? object code) ????????????????? execute
    file
  • execute file ?????????????????????????????????????
    ??????????? (run) ???????? ?????????? compile
    ??????
  • ???????? ?? tools ????????? text editor
    compiler linker ??????????????
    ?????????????????????????????????????????????????
    (?????????????????????????????????) ??? Turbo C
    compiler

5
Text editor
create
Source file (.c)
Error
C compiler
Object file (.obj)
Library (header file , .h)
C linker
Execute file (.exe)
6
??????????????????????
  • Bitwise Control ??????????????????????????
    (bit) ?????????????????????????????????????????
  • ??????????????????????????????????????????
  • Pointer Implementation ??????????????????
    (pointer)
  • ???????????????????????????????????????????
  • Case Sensitive ?????????????????????????????????
    ???????????
  • ?????? var1 ????????? Var1 ?????????????????
  • main() ??? Main() ???????????????????

7
  • ???????????????????????????? (semicolon)
    ?????????????? ?????????????????????????????????
    ?
  • ??????????????????????????????????????????????????
    ????????????????????
  • Structure language ?????????????????????
    ???????????????????????????????????????? (Control
    structure) ???
  • Procedural language ????????????????????????????
    module (???????????????????????????
    ??????????????????????????) ??? ??????????????
    function

8
???????????????? C
Preprocessor
include ltstdio.hgt void main() /
display message / printf(Hello World)
Header
Comment
Statement
Function
9
  • 1. ??????? (Header)
  • ???????????????????? ??????????????????????
  • ?????????????????????????????????????????????
  • ?????????????? 2 ????
  • 1.1 Preprocessor statement
  • ?????????????????????????????????????????????????
  • ??????????????????????????????
  • ??????????????????????????????????????????? 2
    ?????? ??? define ??? include

10
  • 1.1.1 include
  • ??????????????????????????????????????????????????
    ????????????????? (Library)
  • ????????? header file (.h) ???? stdio.h,
    string.h ???
  • ?????????????????????????????? ???????????????
    ???????? ??? ?????????? printf()
    ??????????????????????????????????????????????????
    (???? ?????)
  • printf() ?????????? (????????) ???????????????????
    ???????? standard input output
  • ??????? ??????????????????????? include ltstdio.hgt

11
  • 1.1.2 define
  • ??????????????????????????????????????????????
    define pi 3.14159 - ???????? idenfier ????
    pi ?????????????????? 3.14159 define pi
    3.14159 - ????????????????????????? string
    3.14156 ????????????
  • ???????????? preprocessor ?????????
    ?????????????
  • 1.2 Declaration statement
  • ?????????????????????? (GLOBAL Variable)
  • ?????????????????????????

12
  • 2. ???????? (Function)
  • ????????????????????????????????????????????? ?
  • ?????????????????????????? (statement) ???? ?
  • ???????????????????????????????? ? ????????
  • ????????????????????????????????????????????
    ???????? main() ??????????????????????????????????
    ???????????????

13
  • comment
  • ???????? ??????????????????????????? (comment)
    ??????????????
  • ?????????????????????????????????????????? /
    ???????????????? /
  • ????????? ? ??????????????????????????????????????
    ???????????????????
  • ???????????????????????????????? ????????????????
    // ?????????????????????????????????????????

14
??????????????????????
  • ????????????? c\tc
  • ?????????? run ????????????? c\tc\bin\tc.exe
  • ... ??????????????????????????? ??????????????

15
Ex. 1
  • / A first program in C /
  • include ltstdio.hgt
  • int main()
  • // print message hello world to screen
  • printf(Hello world\n)
  • return 0 // indicate end program
Write a Comment
User Comments (0)
About PowerShow.com