by shervin daneshpajouh syllabus syllabus
play

By Shervin Daneshpajouh Syllabus Syllabus See the syllabus file 2 - PowerPoint PPT Presentation

By Shervin Daneshpajouh Syllabus Syllabus See the syllabus file 2 Shervin Daneshpajouh References References C: How to Program (6th Edition) Deitel & Deitel 3 Shervin Daneshpajouh Basics Basics of a Typical of a Typical


  1. By Shervin Daneshpajouh

  2. Syllabus Syllabus • See the syllabus file 2 Shervin Daneshpajouh

  3. References References • C: How to Program (6th Edition) • Deitel & Deitel 3 Shervin Daneshpajouh

  4. Basics Basics of a Typical of a Typical C/C C/C++ Environment ++ Environment C/C++ systems � Program-development environment � Language � C/C++ Standard Library 4

  5. Development Environment Development Environment • Bloodshed • www.Bloodshed.net • Codeblocks • www.codeblocks.org • www.codeblocks.org 5 Shervin Daneshpajouh

  6. Basics of a Typical Basics of a Typical C/C C/C++ Environment ++ Environment Phases of C/C++ Programs: Program is created in Editor Disk the editor and stored on disk. 1. Edit Preprocessor program Preprocessor Disk 2. Preprocess processes the code. Compiler creates 3. Compile Compiler object code and stores Disk it on disk. 4. Link Linker links the object Linker Disk code with the libraries, 5. Load 5. Load creates a.out and stores it on disk Primary Memory 6. Execute Loader Loader puts program in memory. Disk . . . . . . Primary Memory CPU CPU takes each instruction and executes it, possibly storing new data . . values as the program . . . . executes. 6

  7. General General Notes About Notes About C/C++ C/C++ Book geared toward novice programmers � Stress programming clarity � simple and straightforward manner � KIS ("keep it simple"). Portability Portability � C and C++ are portable languages � C and C++ programs can run on many different computers Compatibility � Many features of current versions of C++ not compatible with older implementations 7

  8. 8 Shervin Daneshpajouh

  9. Why Learning a Programming Language? Why Learning a Programming Language? � Some Applications � Office � Excel � Engineering � Engineering � Scientific purpose 9 Shervin Daneshpajouh

  10. Why Learning a Why Learning a Programming Language? Programming Language? � Some Applications � Office � Engineering � Mechanical Eng. � AVEVA PDMS � AVEVA PDMS � (Plant Design Tool) � Programmable Macro PDMS Language (PML) � Fluid Dynamics Computation � Scientific purpose 10 Shervin Daneshpajouh

  11. Why Learning a Why Learning a Programming Language? Programming Language? � Some Applications � Office � Engineering � Scientific purpose � Scientific purpose � Numerical Analysis � MATLAB MATLAB 11 Shervin Daneshpajouh

  12. Why learn C? Why learn C? • The most widely used programming language. • Many scientific instruments are programmed in C • C is closer to assembly language, so you can have finer control over what the computer is doing, and thereby make faster programs. programs. • There is a free C compiler available (GNU C, gcc), that is of very high quality and that has been ported to numerous machines. • UNIX is written in C, so it is easier to interface with UNIX-like operating systems (such as GNU/Linux) if you write in C. 12 Shervin Daneshpajouh

  13. The simplest possible C program The simplest possible C program main () {} 13 Shervin Daneshpajouh

  14. 14 Shervin Daneshpajouh

Recommend


More recommend