1 / 21

程式設計 C 語言

程式設計 C 語言. 鄧姚文 joseph@im.knu.edu.tw http://w3.im.knu.edu.tw/~joseph/. 課程介紹. 課程大綱網址 課程參考資料網址. http://w3.im.knu.edu.tw/~joseph/courses/knu/2003/C/outline.html. http://w3.im.knu.edu.tw/~joseph/courses/knu/2003/C/index.html. C 語言的由來.

marrim
Download Presentation

程式設計 C 語言

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 程式設計 C 語言 鄧姚文 joseph@im.knu.edu.tw http://w3.im.knu.edu.tw/~joseph/

  2. 課程介紹 • 課程大綱網址 • 課程參考資料網址 http://w3.im.knu.edu.tw/~joseph/courses/knu/2003/C/outline.html http://w3.im.knu.edu.tw/~joseph/courses/knu/2003/C/index.html

  3. C 語言的由來 • 196x 年 Ken Thompson 與 Dennis Ritchie 為了開發 Space War(太空歷險遊戲)結果研發出 UNIX 作業系統 • AT&T Bell Telephone Laboratories(BTL) • Multics(Multiplexed Information and Computing Service) • UNICS (UNiplexed Information and Computing Service) => UNIX

  4. 硬體 Kernel(核心) 管理電腦系統運作 使用者 Shell(殼層) 提供使用者與電腦資源之間的界面 使用者、作業系統與硬體的關係

  5. C 語言的由來(續) • 將 UNIX 作業系統從一個硬體平台移植到另一個硬體平台 • GE 645 • DEC PDP-7(Programmed Data Processor) • 4K memory for user programs • Cross-assembly on GECOS, paper tape to PDP-7 • DEC PDP-11(1971) • 16KB RAM for system • 8KB RAM for program • 512KB disk space, 64KB per file

  6. C 語言的由來(續) • Thompson 打算在 PDP-11 電腦的 UNIX 系統上開發 Fortran Compiler • 結果 Richie 發展出 B 語言:a cut-down version of BCPL(Basic Combined Programming Language, Martin Richards) • 1972 年 Ritchie 重寫 B 語言,發展出 C 語言 • 1973 年 Unix 以 C 語言重寫

  7. 高階程式語言與低階程式語言 JAVA BASIC PASCAL FORTRAN COBOL C 高階 低階 Compiler 編譯器 M 牌 CPU 組合語言 P 牌 CPU 組合語言 I 牌 CPU 組合語言 M 牌 CPU 機器語言 P 牌 CPU 機器語言 I 牌 CPU 機器語言 Assembler 組譯器 M 牌 CPU P 牌 CPU I 牌 CPU

  8. C 語言的由來(續) • 非官方標準 • Brian Kerninghan and Dennis RitchieThe C Programming LanguagePrentice-Hall, 1978 • ANSI C, 1983, 1989, 1996 (American National Standards Institute)

  9. C 語言的重要性 • UNIX 作業系統本身以及 UNIX 作業系統上的系統程式與應用程式幾乎都是以 C 語言寫成的 • 幾乎所有的驅動程式(任何作業系統)都是以 C 語言寫成的 • 不會 C,無法做好網路系統的開與發管理 • 由 C 語言延伸出眾多的語言 • C++, Java, C# • C Shell Script, Perl, PHP

  10. C 語言程式開發流程

  11. 編譯器 • Compiler 編譯器 • 整批作業,把原始程式整篇轉換成機械語言 • 程式執行時不需要執行環境(Run-Time Environment),執行檔與原先開發程式時所使用的程式語言已無關連 • Interpreter 直譯器 • 程式執行時需要一個執行環境 • 一次轉換一行原始程式,並立即執行指令 • 不產生執行檔

  12. 常見的 C Compiler • GNU C Compiler (gcc) • Microsoft Visual C/C++ (Visual Studio) • TURBO C, Borland C/C++

  13. 整合式開發環境 • IDE ( Integrated Development Environment) • 將多種程式開發工具整合在一起 • Editor 編輯器 • Compiler 編譯器 • Debugger 除錯工具 • Project Management 專案管理 • Profiler 效能剖析

  14. 整合式開發環境 • Microsoft Visual C/C++ • TURBO C • Dev-C++

  15. TURBO C • 下載課本附 TURBO C 2.01 版 • 將 TC201.zip 解壓縮到 C:\ • 執行 C:\TC201\TC.EXE http://w3.im.knu.edu.tw/~joseph/courses/knu/2003/C/TC201.zip

  16. Dev-C++ • 從 SourceForge 下載 Dev-C++或下載校內副本 • 執行 devcpp4970-gcc32.exe 開始安裝 http://unc.dl.sourceforge.net/sourceforge/dev-cpp/devcpp4970-gcc32.exe http://w3.im.knu.edu.tw/download/Dev-Cpp/devcpp4970-gcc32.exe

  17. MinGW • Minimalist GNU For Windows • 下載處 • 或下載校內副本 • 安裝 • MinGW-2.0.0-3.exe http://www.mingw.org/download.shtml http://w3.im.knu.edu.tw/download/MinGW/

More Related