Introduction to C programming
Introduction to the C Programming Language
C is a general-purpose, high-level programming language originally developed by Dennis M. Ritchie at Bell Labs to build the UNIX operating system.
C was first implemented in 1972 on the DEC PDP-11 computer.
Key Features of C Language
-
Provides low-level access to memory
-
Has a simple and small set of keywords
-
Follows a clean and structured programming style
These features make C highly suitable for:
-
System programming
-
Operating system development
-
Compiler development
Influence on Other Programming Languages
Many modern programming languages have borrowed syntax and features from C, either directly or indirectly.
Examples include:
-
Java
-
PHP
-
JavaScript
C++ is almost a superset of C, adding object-oriented programming features while retaining most of C’s functionality.
Ken Thompson (left) with Dennis Ritchie (right, the inventor of the C programming language)
History and Standards of the C Programming
Language
Early Development
-
The C programming language was developed in 1972 at Bell Laboratories by Dennis Ritchie.
-
C was derived from an earlier language called B, which itself came from BCPL (Basic Combined Programming Language).
-
C was invented primarily to implement the UNIX operating system.
-
The UNIX OS, C compilers, and many UNIX applications were written in C.
K&R C (First Description)
-
In 1978, Dennis Ritchie and Brian Kernighan published the book
“The C Programming Language.” -
This became the first widely available specification of C.
-
The version described in this book is known as K&R C.
ANSI Standardization
-
In 1983, the American National Standards Institute (ANSI) formed a committee to standardize C.
-
The ANSI C standard was completed in 1988.
-
This version differed from K&R C in several ways and provided a modern, formal definition of the language.
C Language Standards Timeline
✔ C89 / C90
-
First standardized specification
-
Developed by ANSI in 1989
-
C89 and C90 refer to the same standard
✔ C99
-
Published in 1999
-
Introduced:
-
New data types
-
Language improvements
-
Library enhancements
-
✔ C11
-
Final draft published in 2011
-
ISO standard: ISO/IEC 9899:2011
-
Added features such as:
-
Unicode support improvements
-
Multi-threading support
-
Atomic operations
-
Type-generic macros
-
Anonymous structures
-
Bounds-checked functions
-
-
Some C99 library portions became optional
-
Improved compatibility with C++
✔ C17
-
Published October 2018
-
Fixes defects in C11
-
No major new language features
✔ C2x (Next Standard)
-
Informal name for the revision after C17
-
Planned future update (timeline initially expected around 2021)
C11 and Embedded C
C11 Adds
-
Type-generic macros
-
Anonymous structures
-
Better Unicode support
-
Multi-threading
-
Atomic operations
-
Safer functions
Embedded C Includes Extra Features
-
Fixed-point arithmetic
-
Named address spaces
-
Direct hardware I/O addressing
Nature of the C Programming Language
-
Structured-oriented language
-
Procedure-oriented programming language
-
Middle-level programming language
-
Known for being:
-
Reliable
-
Simple
-
Efficient
-
Easy to use
-
C was originally implemented using assembly language.
Features of C Programming Language
-
Reliability
-
Portability
-
Flexibility
-
Interactivity
-
Modularity
-
Efficiency and effectiveness
Uses of C Programming Language
C is widely used for system and application software, including:
-
Operating system development (Windows, UNIX, Linux)
-
Database systems
-
Graphics packages
-
Word processors
-
Spreadsheets
-
Compilers and assemblers
-
Network drivers
-
Interpreters
Examples:
-
Linux OS written largely in C
-
MySQL database implemented in C
Levels of Programming Languages
1️⃣ Middle-Level Languages
-
Provide building blocks for programming
-
Offer both low-level and high-level features
Examples: C, C++
2️⃣ High-Level Languages
-
Provide many built-in functions
-
Easier for programmers to use
Examples: Java, Python
3️⃣ Low-Level Languages
-
Provide direct access to machine instructions
Example: Assembly language
C as a Structured Language
Structure-Oriented Languages
-
Large programs divided into functions
-
Focus on procedures/functions operating on data
-
Data moves between functions freely
-
Uses Top-Down approach
Examples: C, Pascal, ALGOL, Modula-2
Object-Oriented Languages
-
Programs divided into objects
-
Focus on data
-
Data is hidden (encapsulation)
-
Uses Bottom-Up approach
Examples: C++, Java, C#
Non-Structured Languages
-
No strict programming structure
Examples: BASIC, COBOL, FORTRAN
Key Points to Remember About C
-
Developed by Dennis Ritchie
-
Created to write UNIX operating system
-
Successor of B language
-
Standardized by ANSI in 1988
-
Belongs to middle-level programming languages
-
Widely used for system programming
-
Many modern software systems use C
-
Operating systems like Windows, UNIX, Linux use C
-
Major standardized versions include:
-
C89/C90
-
C99
-
C11
-
C17
-

.jpg)
Comments
Post a Comment