Introduction to C Language

KamalAcharya 1,844 views 18 slides Apr 24, 2014
Slide 1
Slide 1 of 18
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18

About This Presentation

No description available for this slideshow.


Slide Content

Introduction to C language advantages Of C Languages Structure of C Program Writing and compiling C Program Introduction to C Language

Introduction to C Language The C programming language was designed by Dennis Ritchie at Bell Laboratories in the early 1970s It was influenced by the following programming languages: ALGOL 60 (1960), CPL (Cambridge, 1963), BCPL (Martin Richard, 1967), B (Ken Thompson, 1970)

Advantages Of C Modularity General Purpose Programming Language Middle Level Language Portability Speed Of Compilation

Disadvantages Of C Lack of OOP features No Namespace features No concept of constructor and destructor

Interpretation Interpretation and compilation are different ways of translating high-level languages. Interpreter is program that executes program statements Generally execute one line/command at a time Limited processing power E asy to debug, make changes, view intermediate results L anguages : BASIC, LISP , Perl, Matlab , C-shell

Compilation Translates statements into machine language D oes not execute, but creates executable program C hange requires recompilation L anguages : C, C++, Fortran, Pascal

Structure Of C Program

Documentation: Name of the programmer Other detail about the program which the programmer think can be useful later Preprocessor Statements: Begins with # sign. Command to include header files or symbolic constant before compiling the program

Global Declarations: Declaration of function or the global variables. Main Function: Execution starts from here

Compiling C Program Preprocessing: Read source code and evaluate preprocessor part. Compiling: Convert source code to assembly code Assembling: Create object code. Linking: Link above object code files and other library files to produce one complete executable file.

Compiling C Program

Sample C Program

Compiling C Program

Unsuccessful Compilation

List of Errors

Successful Compilation

Running the Program

Output