PINCU1L4

BASICS OF  C  PROGRAMMING

Introduction to C programming:

The programming language C was developed in the early 1970s by Dennis Ritchie at Bell Laboratories to be used by the UNIX operating system. It was named 'C' because many of its features were derived from an earlier language called 'B'. Although C was designed for implementing system software, it was later on widely used for developing portable application software.

Background

  • C is derived from ALGOL (the first language to use a block structure). 

  • In 1967 Martin Richards developed a language called BCPL (Basic Combined Programming Language). 

  • In 1970, Ken Thompson developed a language called B. B was used to develop the first version of UNIX. 

  • C was developed by Dennis Ritchie in 1972 that took concepts from ALGOL, BCPL, and B. In addition to the concepts of these languages, C also supports the concept of data types. Since UNIX operating system was also developed at Bell Laboratories along with C language, C and UNIX are strongly associated with each other.

  • For many years, C was mainly used in academic institutions, but with the release of different C compilers for commercial use and popularity of UNIX, C was widely accepted by computer professionals.

  • C is a robust language whose rich set of built-in functions and operators can be used to write complex programs. 

  • The C compiler combines the features of assembly languages and high-level languages, which makes it best suited for writing system software as well as business packages. 

  • The tremendous growth of C language resulted in the development of different versions of the language that were similar but incompatible with each other. 

  • Therefore, in the year 1983, the American National Standards Institute (ANSI) started working on defining the standard for C. This standard was approved in December 1989 and came to be known as ANSI C. 

  • In 1990, the International Standards Organization (ISO) adopted the ANSI standard. This version of C came to be known as C89. 

  • In 1995, some minor changes were made to C89, the new modified version was known as C95.

  • In 1999 when some significant changes were made to C95, the modified version came to be known as C99. 

Characteristics of C

  • C is a robust language used write complex programs.

  • C compiler combines the features of assembly language and high level language.

  • C is a high-level programming language which enables the programmer to concentrate on the problem at hand and not worry about the machine code on which the program would be run. 

  • Small size C has only 32 keywords. This makes it relatively easy to learn as compared to other languages.

  • C makes extensive use of function calls.

  • C is well suited for structured programming. (Think of problem in terms of functions/modules where the collection of all the modules makes up a complete program.) 

  • Unlike PASCAL it supports loose typing (as a character can be treated as an integer and vice versa).

  • Structured language as the code can be organized as a collection of one or more functions.

  • Stable language. ANSI C was created in 1983 and since then it has not been revised.

  • Quick language as a well written C program is likely to be as quick as or quicker than a program written in any other language. 

  • Facilitates low level (bitwise) programming.

  • Supports pointers to refer computer memory, array, structures, and functions.

  • Core language. If you know C, learning other computer languages becomes much easier.

  • C is a portable language, i.e., a C program written for one computer can be run on another computer with little or no modification.

  • C is an extensible language as it enables the user to add his own functions to the C library.

 Uses of C

  • C language is primarily used for system programming.

  • The portability, efficiency, the ability to access specific hardware addresses, and low runtime demand on system resources make it a good choice for implementing operating systems and embedded system applications.

  • C has been so widely accepted by professionals that compilers, libraries, and interpreters of other programming languages are often implemented in C.

  • For portability and convenience reasons, C is sometimes used as an intermediate language for implementations of other languages. Examples of compilers who use C this way are BitC, Gambit, the Glasgow Haskell Compiler, Squeak, and Vala.

  • Basically, C was designed as a programming language and was not meant to be used as a compiler target language. Therefore, although C can be used as an intermediate language it is not an ideal option. This led to the development of C-based intermediate languages such as C.

  • C is widely used to implement end-user applications.

No comments:

Post a Comment