Introduction to C
Introduction
C is a general-purpose procedure-oriented programming language developed by Dennis Ritchie in 1972 at Bell Telephone Laboratories (now AT and T Bell Laboratories).
C evolved from older languages like BCPL and B language.
C is a middle-level language as it has features of both high-level (development of the program is more straightforward and more understandable) and low-level languages (direct interaction with hardware).
Previous languages (BCPL and B) from which C is evolved are 'type-less' languages, C introduced the concept of data types and many other features.
Unix operating system and its applications are almost entirely written in C. The UNIX operating system’s development started in 1969, and its code was rewritten in C in 1972. The C language was actually created to move the UNIX kernel code from assembly to a higher-level language, which would do the same tasks with fewer lines of code.
Why named as 'C'
The name "C" was derived from its predecessor, the B programming language developed by Ken Thompson. C was created as an evolution of B, with added features for structured programming and system-level access. The choice of the letter "C" reflects its position as the successor to B, as well as its versatility and closeness to the hardware "B" is the letter that comes before "C" in the alphabet.
Some widely known products and applications that use C
Operating Systems
Unix OS is entirely written in C, and the Linux OS kernel is written in C with some portion developed in assembly.
Mobile OS
The kernel of the world’s most popular mobile operating system Android is also having a part written in C.
Databases
The world’s most popular databases, including Oracle Database, MySQL, etc., are coded in C along with C++.
Programming Languages
Many modern programming languages including C++, Java, C#, Python, Ruby, PHP, etc., are influenced by the C language and have their initial implementations written in C.
Features and Advantages Of C Language
General-Purpose Programming Language
C is a general-purpose programming language which can be used to develop various applications of different domain.
Portable Language
C is a portable language. It means that C programs written for a computing environment can easily run on another computer having the same environment.
Block-Structured Language
C is a structured programming language that allows a complicated program to be broken into manageable subprograms called functions. It also allows free movement of data across these functions.
Mid-level Language
C is a middle-level language as it has features of both high-level (development of the program is straightforward, simple and more understandable) and low-level languages (direct interaction with hardware).
Extensible
One of the essential aspects of C is its ability to extend itself, i.e., we can define and add our functions to C library.
Reliable
It is more reliable as compared to its evolving languages.
Typed Language
C introduce the concept of data types and contains a powerful data definition. The data type supported are characters, alphanumeric, integers, long integer, float, double. It also supports string manipulation in the form of character-array.
Powerful Operator Support
C supports a powerful set of operators.
Vast Built-In Library
C language has a rich library that provides numerous built-in functions. It also offers dynamic memory allocation.
Hardware Interaction
C can directly interact with the hardware; as a result, the execution of the program is faster.
Graphical Applications
C also supports robust graphics programming.
Relation with assembly
C works closely with machines and matches assembly language in many ways. We can directly insert the Assembly code into C programs.
Some drawbacks of C
C does not support the concept of OOPs as it is a POP language.
C does not support runtime checking.
C is not a strictly typed language, i.e., we can pass an integer value to a floating-type variable or vice versa.
C does not provide any data security.
C doesn’t have the concept of the namespace.