C/C ??????%20???? - PowerPoint PPT Presentation

About This Presentation
Title:

C/C ??????%20????

Description:

Title: HTML Author: NB1 Last modified by: Joe Chen Created Date: 2/8/2001 6:27:07 PM Document presentation format: – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 65
Provided by: NB14
Category:

less

Transcript and Presenter's Notes

Title: C/C ??????%20????


1
C/C??????????
P725
  • ????_____________
  • ????_____________

2
??????(I)
  • ???????????1???????C?????,?????????C???
  • ???????????????,?23???????????????????C??????????
    ???,??4????????,?5????????,????????????????
  • ?67????????????C????????????,?????????????????C??
    ???,?810????C??????????????

3
??????(II)
  • ????????????,??11??????C?C??,?1213?????????????
    ??????????????????????????????????????????????????
    ?????
  • ????????????,??1516????????????????C???????????
    ??????,??17???C?????????,??????????C??????
  • ???C?D?????????????????????,??????????????????????
    ??,????????????????

4
??(I)
  • ?? ???????
  • 1. ?????C?????
  • ?? ???????????
  • 2. ???????????
  • 3. ???????
  • 4. ??????
  • 5. ?????
  • 6. ??
  • 7. ??
  • 8. ???????
  • 9. ?????? ????????
  • 10. ????????

5
??(II)
  • ?? ????????
  • 11. ?C?C??
  • 12. ????? ??
  • 13. ????????????
  • 14. ??????????
  • ?? ????????
  • 15. ???????
  • 16. ?????
  • ?? ??????
  • 17. ??
  • 18. ?????????

6
??(III)
  • ??ADev-C????????????
  • ??BVisual C2005 Express??????
  • ??C????-??????C??
  • ??D????-??????C??
  • ??EC?C????????
  • ??FASCII??

7
?1? ?????C?????
  • 1-1 ???????
  • 1-2 ?????????
  • 1-3 C?????
  • 1-4 ????C????
  • 1-5 C?????????
  • 1-6 ???C???C????
  • 1-7 C???????

8
1-1 ???????
  • 1-1-1 ?????
  • 1-1-2 ???????
  • 1-1-3 ????
  • 1-1-4 ????
  • 1-1-5 ???????

9
1-1 ???????
  • ??????(Programming Languages)????????????,????????
    ?????????,???????????????,???????,????????????????
    ?????????

10
1-1-1 ?????-??
  • ????(Programs)?????????????????????????????????,??
    ??????????,??????????,???????????????????

11
1-1-1 ?????-??
  • ????(Softwares)?????????????????,???????????????,?
    ????????,??????(Applications)??????????????,?????
    ?????????????????????????

12
1-1-2 ???????
  • ??????????,?????????????,??????????,?????????,????
    ????,?????

13
1-1-3 ????
  • ????(Low Level Languages)????????????????,????????
    ????,?????,??????????
  • ????(Machine Language)?????0?1?????????,?????????
    ?,???????
  • ????(Assembly Language)????????????????0?1???????
    ??,?????????(Assemblers)?????????,???????

14
1-1-4 ????-??
  • ????(High Level Languages)??????????????,???????(H
    alf-english)?????,???????????,?????????,?????????,
    ????????????????????????,??????,????????????
  • ??????????C/C?C?Java?FORTRAN?COBOL?Pascal?BASIC
    ??

15
1-1-4 ????-????
  • ????(Compilers)
  • C/C?Java???????????,???????????????????,????????
    ???,??????????????,?????????,????
  • ???????
  • ????????????????

16
1-1-4 ????-????
  • ????(Interpreters)
  • ???BASIC??(??BASICA?QuickBasic?)????????????(Scri
    pts)??,???????????,????????????,??????????,???????
    ??,???????????????????
  • ??VBScript?JavaScript????????

17
1-1-5 ???????-??
  • ?????????????????????????????????,?????CPU??????(I
    nstruction Set),??CPU????????,?????????????
  • CPU????????
  • ?????????????????????
  • CPU?????????????????,?????,CPU??????????????????CP
    U?????,???????????

18
1-1-5 ???????-??
19
1-1-5 ???????-?????(??)
  • ??CPU????????,??????????????IC?(Integrated
    Circuit),??????????ALU?(Arithmetic and Logic
    Unit)?????????,????????????
  • ?CPU??????????(Registers),??????CPU?????,?????????
    ??????,??????????2????,?????????????????

20
1-1-5 ???????-?????(???)
  • CPU??????????????(Fetch-and-execute)??????,????
  • ?????(Instruction Register,IR)??????????????
  • ???????(Instruction Counter,IC)????????????????
  • ????????(Memory Address Register,MAR)????????????
    ?????
  • ????????(Memory Data Register,MDR)??????????????

21
1-1-5 ???????-???(??)
  • ????????,??????????????????????????(Main
    Memory),???CPU?????????,CPU??????????????
  • ???,????????????????RAM(Random Access
    Memory),??????????????????(Address)???????,???????
    ,???????????,??????????????,????????????

22
1-1-5 ???????-???(??)
  • ????CPU?????????????????,????
  • Step 1???????????CPU?????????,?????????????,???
    ????4?
  • Step 2??????????CPU??????????????,??,??4????0101
    0101,????,?????01010101?????,???0?1???????(Bit),8?
    ?????????(Byte),???????????????

23
1-1-5 ???????-??/????
  • ?????/??????????,????????????????????,????,???????
    ?????????????????????
  • ????????????????????,??????????????????????,??????
    ??A???,???????ASCII?(American Standard Code for
    Information Interchange)??
  • ????A?65,????,???????????????65?

24
1-2 ?????????
  • 1-2-1 ????????
  • 1-2-2 ???????????
  • 1-2-3 ???????
  • 1-2-4 ????????

25
1-2 ?????????-??
  • ????????????(Software Engineering)????????????????
    ???????????,????????????????????????????
  • ??????(Programming)??????????,??C/C??,?????????
    ??????,???????????????????????????

26
1-2 ?????????-??????
  • ??????(Programming Techniques)?????????????????,??
    ???????(Programming Styles),????
  • ????????(Unstructured Programming)?
  • ???????(Procedural Programming)????????(Structured
    Programming)?
  • ???????(Modular Programming)?
  • ????????(Object-Oriented Programming)?

27
1-2-1 ????????
  • ??????????,???????????????C????,??????????????????
    ??????,??????main()???,??????????????,?????

28
1-2-2 ???????????-??
  • ???????????????????????????(Procedures,???Subrouti
    ne?Routine)?????(Functions),??????????????
  • ????????????????,?????????????????????????(Procedu
    re Call),???????????????????????,?????????????????
    ??,?????????????

29
1-2-2 ???????????-??
  • ??????????,??????????????????????????,????????????
    ??????????,?????

30
1-2-3 ???????-??
  • ??????????????????????,???????????????????????????
    ??(Modules),????????????????
  • ?????????????????,????????????,?????????????(Libra
    ries)????,???????????(Toolbox)?

31
1-2-3 ???????-??
  • C??????,???C?????????????,????????????????????,???
    ?????(Information Hiding)?

32
1-2-4 ????????-??
  • ???????????????????,???????????????????
  • ????????????????????????,???????????,????????????,
    ???????(Object)?
  • ????????,??????????????,??????????,?????????????,?
    ?????????????,????????,???????????????????????????
    ?????

33
1-2-4 ????????-??
  • C?????????????,C??????????????,??????????C????

34
1-3 C?????
  • 1-3-1 C?????
  • 1-3-2 C?????
  • 1-3-3 C?????

35
1-3-1 C?????
  • C????Dennis Ritchie?1972??????????????,??????C,???
    ?C?????????????B(?Ken Thompson??),B?????Martin
    Richards???BCPL?????
  • 1980??C??????????????????,???????????????,????????
    ?????????????
  • ?1980????,Bjarne Stroustrup??????????C???????????,
    ??C,C??????Windows??????????????????

36
1-3-2 C?????
  • C??????????,?????????????,???????????
  • C????????????,?????????????C?????????????,??C?????
    ???????????????????
  • C???????????,???????,???,C???????????,C???????C???
    ????????
  • C???????????(Preprocessor)?????????

37
1-3-3 C?????-KR C
  • KR C
  • 1978?Ritchie?Brian Kernighan???The C Programming
    Language?(??KR)??,?????C???????KR
    C??,????C?????C????,????
  • struct???????
  • long int?unsigned int?????
  • ??????

38
1-3-3 C?????-ANSI-C
  • ANSI-C
  • ?1983??????????(American National Standards
    Institute,??ANSI)??X3J11?????C??????,1989?????????
    C?????ANSI X3.159-1989Programming Language
    C????,?????????ANSI-C???
  • ANSI-C??C(C?1980?????Bjarne
    Stroustrup??)???????,????????????C?????????

39
1-3-3 C?????-C99
  • C99
  • ??C???????,ISO?1990???C??????ISO
    98991999,????C????C99,ANSI?2000???????,C99?????,?
    ???
  • ??C???//?
  • ??long long int?boolean??????
  • ??C??????????????
  • ???????

40
1-4 ????C????
  • 1-4-1 ???????
  • 1-4-2 ???

41
1-4-1 ???????-??
  • ???????????????????,????????????????,?????????????
    ?,???,??????????????,?????

42
1-4-1 ???????-??
  • ??(Requirements)
  • ???????????????,??????????????????????????????1??
    100???,???????????1?100,????????????5050?

43
1-4-1 ???????-??
  • ??(Design)
  • ???????????,???????????????????,????,?????????????
    ????1??100?1234.100???,?????????????????,???
    ?????????,????????????

44
1-4-1 ???????-??
  • ??(Analysis)
  • ?????????????????????100???,??????100???????,????
    ??(??????)???,???????????????????????,????????????
    ??,??????????????
  • ???????????????,????????????????,?????????,???????
    ???????,????????????????????

45
1-4-1 ???????-?????
  • ?????(Coding)
  • ????????????????????,????????C??,????????,????????
    ????,???????,?????????????????,?????????????,?????
    ??????????

46
1-4-1 ???????-??
  • ??(Verification)
  • ?????????????????????,???????????,????
  • ?????????????????????,?????????????,?????????????
    ??
  • ??????????????????????,?????????,???????,????????
    ???
  • ??????????????,???????????,??????????,???????????
    ????

47
1-4-2 ???-??
  • ????????????????????????????????(Algorithms),?????
    ??
  • ???????????????,????????????????,????????????,????
  • ??(Input)?????????????
  • ??(Output)??????????
  • ???(Definiteness)????????????,???????
  • ???(Finiteness)??????????
  • ???(Effectiveness)????????,????????

48
1-4-2 ???-??
  • ???????????????????,?????????,????????????????????
    ,?????????
  • ???????????????????????
  • ???(Pseudo Code)?????????????,????????,??????????
    ?????
  • ???(Flow Chart)??????????????,?????????????????,?
    ???????????

49
1-5 C?????????
  • 1-5-1 C?????????
  • 1-5-2 C???????

50
1-5-1 C?????????-??
  • ???C?????????,????????????????,????????????,?????C
    ???????,?????,?????

51
1-5-1 C?????????-??
  • ?????(Editing)C??????????????ASCII????,C?????????
    ???.c?
  • ?????(Compiling)?????????????,???????????????????
    ??CPU????????(Object Files),?????.obj?.o?
  • ?????(Linking)??????????????????????,???????????,
    Windows?????????.exe?
  • ??????(Executing)???C????????.exe?,??????????????
    ??C????????

52
1-5-2 C???????-??
  • ???????????(Development Environment)??????????????
    ??????????????????????????????????,???IDE?(Integra
    ted Development Environment),?????????????????????
    ????????
  • ???MS-DOS?UNIX?Linux??????,????????(Terminals),???
    ??????????????????????(Command-line
    Interface),????????????????????,??????C???????????
    ?????????????C??????????

53
1-5-2 C???????-??
  • Turbo C/C?Borland CBorland???MS-DOS?????????C
    /C????????,???????????,?Windows???????MS-DOS????
    ????????????
  • Microsoft Visual C?????C????,??Windows???????
    ?????,????????Visual C 2005 Express,?????????B?
  • Borland C BuilderBorland???Windows????????C/C
    ???????
  • Dev-CBloodshed Dev-C(??GNU?GCC????),????C/C
    ?????????,????????,???Windows 98/ME/2000/XP??????,
    ?????????A?

54
1-6 ???C???C????-??
  • ????????C?????????,????
  • Step 1???????????????,???????????????(Project)???
    ??(Workspace),??????????
  • Step 2???????C????,??C???????,????.c?
  • Step 3????????????,??????????C?????

55
1-6 ???C???C????-??
  • ?????
  • ??????
  • ???????
  • int main(???)
  • ????
  • ???? ????1(???)
  • ????
  • ???? ????N(???)
  • ????

56
1-6 ???C???C????-??
  • 01 / ???? Ch1_6.c /
  • 02 include ltstdio.hgt
  • 03 include ltstdlib.hgt
  • 04 int main(void)
  • 05 printf("???C??\n")
  • 06 system("PAUSE") // getchar()
  • 07 return 0
  • 08

57
1-7 C???????
  • 1-7-1 ????
  • 1-7-2 ????
  • 1-7-3 ????
  • 1-7-4 ??????
  • 1-7-5 ?????

58
1-7-1 ????-??
  • C????????(Statements)??,???????????????,??????????
    ?????,????
  • int balance 1000
  • interest balance rate
  • printf("???C????\n")
  • ?1?????????,?2??????????,?3??????????printf()??,??
    ??????(Null Statement)?

59
1-7-1 ????-????
  • ??????????
  • C????????????????,?????????????????,????,???????
    ????????????????,????
  • balance 10000 rate 0.04 interest balance
    rate

60
1-7-2 ????
  • ????(Blocks)??????????,???????????,????
  • int main(void)
  • printf("???C??\n")
  • system("PAUSE")
  • return 0
  • main()???????????????,?C????????????????????

61
1-7-3 ????-ANSI-C
  • ???????????????,??????????????????,????????,??????
    ?????
  • C??????????/???/?????????,????
  • / ???? Ch1_6.c /
  • ??????????/???/??????????C???????????,????
  • / ---------------------------
  • ???? Ch1_6.c
  • ------------------------------ /

62
1-7-3 ????-C99
  • C99????C???????,???????//???????,????????//?????
    ??????????,????
  • // ????
  • printf("???C????\n") // ????
  • ?????????????????C???????,?????C????????????C???
    ?????

63
1-7-4 ??????
  • C???????????????,?????????????,???????????,??????,
    ????
  • result compare((void )ptr, (void )ptr1,
  • (int () (void , void
    ))numcmp)
  • ??????????(??????????'\n'),?????????????\???(Line
    Splicing),????????,????
  • sum scores0 scores1 \
  • scores2 scores3 \
  • scores4

64
1-7-5 ?????
  • ?????????????????,????????,???????????,???????????
    ???????,???????????????,????
  • for ( i 0 i lt 10 i )
  • printf(d\n, i)
  • total total i
Write a Comment
User Comments (0)
About PowerShow.com