History of C language
C is general purpose structured programming language developed in 1972 at Bell laboratories by Dennis Ritchie. Many of the important ideas of C stem from language BCPL, which is developed by Martin Richards. The influence of BCPL on C proceed indirectly through the language B, which was written by Ken Thompson.
In 1983 a committee was formed by American National Standards Institute (ANSI) to standardize the C language. Finally in 1989, the standard for C language was introduced known as ANSI C.
Features of C Language
C provides a variety of data types. The fundamental types are characters, integers, floating point types. In addition there is hierarchy of derived data types created with pointers, arrays, structures and unions. C language has 32 keywords. C provides control instructions to control the sequence of execution of various statements. C is based on functions- standard library functions and user defined functions. C language is useful for writing compilers and operating systems. C language is not tied to any one operating system. C code is also vary portable.
Structure of a C program
Every C program has one or more functions. If a program has only one function it must be main(). The general structure of C program is -
Comments
Preprocessor directives
Global variables
main()
{
local variables
statements
........ .
}
function1()
{
local variables
statements
........ .
}
function2()
{
local variables
statements
........ .
}
.
.
.
function_n()
{
local variables
statements
........ .
}
Comments can be placed anywhere in the program. It may be possible that some variables have to be used in many functions, so it is necessary to declare them globally. The scope of local variable is local to that function only.
1 Comments
Awesome
ReplyDelete