A Short Note On C Language

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

A short note on C language:

 History of Language:
This miraculous language was invented by Dennis
MacAlistair Ritchie and his long-time colleague Ken
Thompson in 1970s at Bell Labs. This language was
based on B language invented in 1969 by Dennis Ritchie.
The C language is still widely used in many devices
ranging from supercomputers to smallest
microcontrollers and embedded system. The C language
is also known as ANSI C by the International
Organization for Standardization (ISO).

 Overview:
C is an imperative, procedural language in the ALGOL
tradition. It has a static type system. In C, all executable
code is contained within subroutines.
The language source text is a free format, using the
semicolon as a statement separator and curly braces for
grouping blocks of statements.

Ken Thompson (left) and Dennis Ritchie(right)


 Memory Management:
One of the most important functions of a programming
language is to provide facilities for managing
memory and the objects that are stored in memory. C
provides three principal ways to allocate memory for
objects:
 Static memory allocation: space for the object is
provided in the binary at compile-time; these
objects have an extent (or lifetime) as long as the
binary which contains them is loaded into
memory.
 Automatic memory allocation: temporary objects
can be stored on the stack and this space is
automatically freed and reusable after the block
in which they are declared is exited.
 Dynamic memory allocation: blocks of memory of
arbitrary size can be requested at run-time using
library functions such as malloc from a region
of memory called the heap; these blocks persist
until subsequently freed for reuse by calling the
library function realloc or free .

You might also like