C Unit1 PartA
C Unit1 PartA
Overview of C Language
Facts about C
• C was invented to write an operating system called UNIX.
• C is a successor of B language which was introduced around 1970
• The language was formalized in 1988 by the American National Standard Institue (ANSI).
• By 1973 UNIX OS almost totally written in C.
• Today C is the most widely used System Programming Language.
History of C language
C language has evolved from three different structured languages ALGOL, BCPL, and B
Language. It uses many concepts from these languages while introduced many new concepts
such as datatypes, struct, pointer, etc.
BCPL was developed by Martin Richards, based on which the B language was created
by Ken Thompson. And then the B language was the language using which the C language
was created.
After the C language was accepted worldwide and programmers around the world started using
it, soon, to improve C language further, the work on the development of C++ language started.
The idea behind creating C language was to create an easy language that requires a simple
compiler (to translate the code from English to binary (0's and 1's that computer understands))
and to enable programmers to write complex programs in a language which is close to
English because earlier programmers had to write Machine instructions which were very
difficult to remember.
C language compiler converts the readable C language code into machine instructions.
Programs that are written in C language take very little time to execute and almost execute at
the speed of assembly language instructions. (Assembly level instructions are nothing but
direct commands to communicate with computer's hardware)
Initially, C language was mainly used for writing system-level programs, like designing
Operating Systems, because in the eighties (1980-89) the fight to make a stable, worldwide
accepted operating system was going on.
But C language can be used to develop other applications as well, like Text Editors,
Compilers, Network Drivers, many traditional PoS(Point of Sale) software like Restaurant
Billing systems, etc.
Characteristics or feature of C:
▪ C is a general purpose programming language.
▪ It is a structured programming language (It allows modularization process of dividing problems
into sub-problems and C has structured statements like sequence, selection and iteration)
▪ C is a middle level language (C is a high level language but also incorporates features of low-level
languages like manipulation of bits, bytes, words and addresses.)
▪ Helps in development of system software ( C is used for writing application programs and since it
has low level languages features it can be used in development of system software)
▪ Has rich set of operators and data types and built-in functions.
▪ Provides compact representation for expressions. This makes the language simple, orderly and easy
to learn.
▪ No rigid format. Any number of statements can be typed in a single line
• Portability: any C program can be run on different machines with little or no modifications.
• Less number of reserved words.
• Pointer,C provides the feature of pointers. We can directly interact with the memory by
using the pointers. We can use pointers for memory, structures, functions, array etc.
• Ability to extend itself by adding functions to its library
• Simple, C is a simple language in the sense that it provides structured approach (to break
the problem into parts), rich set of library functions, data types etc.
• Machine Independent or Portable,Unlike assembly language, c programs can be executed
in many machines with little bit or no change. But it is not platform-independent.
• Case sensitive Language-In C, the uppercase and lowercase characters are different. That
means if is not the same as IF in C language.
The C Compilation Model the compilation is a process of converting the source code into
object code. It is done with the help of the compiler. The compiler checks the source code for
the syntactical or structural errors, and if the source code is error-free, then it generates the
object code.
The c compilation process converts the source code taken as input into the object code or
machine code. The compilation process can be divided into four steps, i.e., Pre-processing,
Compiling, Assembling, and Linking. C source files are typically named with .c extension.