1 / 162

Programming Language  C Tutorial Introduction

Programming Language  C Tutorial Introduction. 主講人:虞台文. Content. Background Getting Started IDE (Integrated Development Environment) Main Parts of C Programs Variables and Arithmetic Expressions The for statement Symbolic Constants Character Input and Output Arrays Functions

mbickham
Download Presentation

Programming Language  C Tutorial Introduction

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. Programming Language  CTutorial Introduction 主講人:虞台文

  2. Content • Background • Getting Started • IDE (Integrated Development Environment) • Main Parts of C Programs • Variables and Arithmetic Expressions • The for statement • Symbolic Constants • Character Input and Output • Arrays • Functions • Character Arrays • External Variables and Scope

  3. Programming Language  CTutorial Introduction Background

  4. Textbooks • C How to Program, 5th Edition, by Harvey M. Deitel , Paul J. Deitel. • The C programming Language, 2nd Editon, by Brian W. Kernighan and Dennis M. Ritchie, Prentice-Hall in 1988.

  5. Grading • Homework 40% • Midterm 30% • Final 30% • Other 10%

  6. The C Language • Currently, the most commonly-used language for embedded systems • High-level assembly • Very portable • compilers exist for virtually every processor • Easy-to-understand compilation • Produces efficient code • Fairly concise

  7. The Development of the C Language C History • Developed between 1969 and 1973 along with Unix • Due mostly to Dennis Ritchie • Designed for systems programming • Operating systems • Utility programs • Compilers • Filters • Evolved from B, which evolved from BCPL

  8. CPU ALU Input Device Output Device Input Output Control Memory Computer Architecture

  9. Programming Language  CTutorial Introduction Getting Started

  10. Setting Program Development Environment

  11. Setting Program Development Environment

  12. Setting Program Development Environment

  13. Setting Program Development Environment

  14. Setting Program Development Environment

  15. %SystemRoot%\system32\cmd.exe /K "F:\VS6\VC98\Bin\VCVARS32.BAT" Setting Program Development Environment

  16. Setting Program Development Environment

  17. Our First C Program  Hello World

  18. Our First C Program  Hello World #include <stdio.h> main() { printf("hello, world\n"); }

  19. Our First C Program  Hello World include information about standard library #include <stdio.h> main() { printf("hello, world\n"); } define a function calledmain that received no argumentvalues

  20. Our First C Program  Hello World #include <stdio.h> main() { printf("hello, world\n"); } define a function calledmain that received no argumentvalues

  21. Our First C Program  Hello World #include <stdio.h> main() { printf("hello, world\n"); } statements of main are enclosed in braces

  22. Our First C Program  Hello World #include <stdio.h> main() { printf("hello, world\n"); } main calls library function printf

  23. Our First C Program  Hello World

  24. Compiling and Linking

  25. Compiling and Linking

  26. Compiling and Linking

  27. Compiling and Linking

  28. Compiling and Linking

  29. Compiling and Linking

  30. Execution

  31. Execution

  32. Exercises • Create some typo errors for Hello.c, and redo the compiling/linking process. Watch and understand the screen output reported by cl. • Add more printf statements in Hello.c and redo the compiling/linking/execution process.

  33. Programming Language  CTutorial Introduction IDE

  34. Visual C++ 6.0

  35. Visual C++ 6.0

  36. Visual C++ 6.0

  37. Win32 Console Application

  38. Win32 Console Application

  39. Win32 Console Application

  40. Hello_IDE

  41. Hello_IDE

  42. Hello_IDE

  43. Hello_IDE

  44. Hello_IDE

  45. Hello_IDE

  46. Hello.c

  47. Building Application

  48. Building Application

  49. Execution

  50. Execution

More Related