680 likes | 1.49k Views
Introduction to C Programming Language. History of C. C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s Successor of: ALGOL 60 (1960), CPL (Cambridge, 1963), BCPL (Martin Richard, 1967), B (Ken Thompson, 1970) Used to develop UNIX. Traditional C:
E N D
Introduction to C Programming Language Mr.Mohamed EL.Saied
History of C C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s Successor of: ALGOL 60 (1960), CPL (Cambridge, 1963), BCPL (Martin Richard, 1967), B (Ken Thompson, 1970) Used to develop UNIX. Traditional C: The C Programming Language, by Brian Kernighan and Dennis Ritchie, 2nd Edition, Prentice Hall. K&R Mr.Mohamed EL.Saied
Standardization • Since it was developed for UNIX, so it was incompatible with any OS or hardware. So need to create an “unambiguous, machine-independent" definition. • ANSI (American National Standards Institute) created standard in 1989. • That standard was updated in 1995 (C95) and finally in 1999 (C99). • C++ &C: • C++ extends C to include support for Object Oriented • programming and other features that facilitate large software • development projects. Because C++ includes C, it is best to • master C, then learn C++. Mr.Mohamed EL.Saied
Characteristics of C C has now become a widely used professional language for various reasons : Structured language General purpose programming language It can handle low-level activities. (hardware programming) Machine independent. Has fast speed execution. Mr.Mohamed EL.Saied
Uses of C C was designed as a system development language because it produces code that runs as fast as the code written in assembly language. Some examples of the use of C might be: Operating Systems Assemblers Language Compilers Language Interpreters Text Editors Network Drivers Databases Utilities Mr.Mohamed EL.Saied
C Standard Library C programs consist of pieces/modules called functions. C provides a set of functions stored in a set of files known as the standard library. Programmers will often use the C library functions as building blocks. A programmer can create his own functions. Advantage: the programmer knows exactly how it works Disadvantage: time consuming Mr.Mohamed EL.Saied
Typical C development Environment Program is created in the editor and stored on disk. Preprocessor program processes the code. Compiler creates object code and stores it on disk. Compiler Linker links the object code with the libraries, creates a.out and stores it on disk Primary Memory Loader Loader puts program in memory. Primary Memory CPU takes each instruction and executes it, possibly storing new data values as the program executes. Preprocessor Linker Editor Disk Disk Disk Disk Disk CPU . . . . . . . . . . . . Phases of C Program: • Edit • Preprocess • Compile • Link • Load & Execute(Run) Mr.MohamedEL.Saied
A programming language is a special languageProgrammers use to develop software programs, scripts, or other sets of instructions for computers to execute. A computer program is a collection of instructions that performs a specific task when executed by a computer. A compiler is a special program written in a particular programming language that translates program statements into machine language or "code" that a computer's processor uses. It gives executable file. An interpreter is a special program written in a particular programming language that translates program statements into machine language or "code" line by line. Mr.Mohamed EL.Saied