by shervin daneshpajouh -...
TRANSCRIPT
![Page 1: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/1.jpg)
By Shervin Daneshpajouh
![Page 2: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/2.jpg)
SyllabusSyllabus
•See the syllabus file
2Shervin Daneshpajouh
![Page 3: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/3.jpg)
ReferencesReferences
•C: How to Program (6th Edition)
• Deitel & Deitel
3Shervin Daneshpajouh
![Page 4: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/4.jpg)
Basics Basics of a Typical of a Typical C/CC/C++ Environment++ Environment
C/C++ systems
� Program-development environment
� Language
� C/C++ Standard Library
4
![Page 5: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/5.jpg)
Development EnvironmentDevelopment Environment
•Bloodshed
• www.Bloodshed.net
•Codeblocks
• www.codeblocks.org• www.codeblocks.org
5Shervin Daneshpajouh
![Page 6: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/6.jpg)
Basics Basics of a Typical of a Typical C/CC/C++ Environment++ EnvironmentPhases of C/C++ Programs:
1. Edit
2. Preprocess
3. Compile
4. Link
5. Load
Program is created in
the editor and stored
on disk.
Preprocessor program
processes the code.
Compiler
Compiler creates
object code and stores
it on disk.
Linker links the object
code with the libraries,creates and
Editor
Preprocessor
Linker
Disk
Disk
Disk
Disk
6
5. Load
6. Execute Loader
Primary
Memory
Loader puts program
in memory.
CPU takes each
instruction and
executes it, possibly
storing new data
values as the program
executes.
creates a.out and
stores it on disk
CPU
Primary
Memory
.
.
.
.
.
.
.
.
.
.
.
.
Disk
![Page 7: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/7.jpg)
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").
PortabilityPortability
� 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
![Page 8: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/8.jpg)
8Shervin Daneshpajouh
![Page 9: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/9.jpg)
Why Learning a Programming Language?Why Learning a Programming Language?
� Some Applications
� Office
� Excel
� Engineering� Engineering
� Scientific purpose
Shervin Daneshpajouh 9
![Page 10: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/10.jpg)
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 Language (PML)
� Fluid Dynamics Computation
� Scientific purpose
Shervin Daneshpajouh 10
PDMS
![Page 11: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/11.jpg)
Why Learning a Why Learning a Programming Language?Programming Language?
� Some Applications
� Office
� Engineering
� Scientific purpose
MATLAB
� Scientific purpose� Numerical Analysis
� MATLAB
Shervin Daneshpajouh 11
![Page 12: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/12.jpg)
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.
12Shervin Daneshpajouh
![Page 13: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/13.jpg)
The simplest possible C programThe simplest possible C program
main () {}
13Shervin Daneshpajouh
![Page 14: By Shervin Daneshpajouh - Sharifce.sharif.edu/.../root/Slides/Programming-C-Slide-01-IntroductionB.pdf · Why Learning a Why Learning a Programming Language?Programming Language?](https://reader030.vdocument.in/reader030/viewer/2022021718/5b5af6e07f8b9a885b8d15f6/html5/thumbnails/14.jpg)
14Shervin Daneshpajouh