Saturday, July 14, 2012

Introduction to 'C' Language

C language is a general purpose and structured programming langauge developed by 'Dennis Ritchie' at AT &T's Bell Laboratories in the 1972s in USA.

It is also called as 'Procedure oriented programming language.                               

C is not specially designed for specific applications areas like COBOL (Common Business-Oriented Language) or FORTRAN (Formula Translation). It is well suited for business and scietific applications. It has some various features like control structures, looping statements, arrays, macros required for these applications.

After a long illness, Dennis Ritchie( September 9, 1941; found dead October 12, 2011), father of Unix and an esteemed computer scientist, died last weekend at the age of 70. 

Ritchie, also known as “dmr”, is best know for creating the C programming language as well as being instrumental in the development of UNIX along with Ken Thompson. Ritchie spent most of his career at Bell Labs, which at the time of his joining in 1967, was one of the largest phone providers in the U.S. and had one of the most well-known research labs in operation. 

Working alongside Thompson (who had written B) at Bell in the late sixties, the two men set out to develop a more efficient operating system for the up-and-coming minicomputer, resulting in the release of Unix (running on a DEC PDP-1) in 1971.

Though Unix was cheap and compatible with just about any machine, allowing users to install a variety of software systems, the OS was written in machine (or assembly) language, meaning that it had a small vocabulary and suffered in relation to memory. 

By 1973, Ritchie and Thompson had rewritten Unix in C, developing its syntax, functionality, and beyond to give the language the ability to program an operating system. The kernel was published in the same year.

Today, C remains the second most popular programming language in the world (or at least the language in which the second most lines of code have been written), and ushered in C++ and Java; while the pair’s work on Unix led to, among other things, Linus Torvalds’ Linux. The work has without a doubt made Ritchie one of the most important, if not under-recognized, engineers of the modern era.

His work, specifically in relation to UNIX, led to him becoming a joint recipient of the Turing Award with Ken Thompson in 1983, as well as a recipient of the National Medal of Technology in 1998 from then-president Bill Clinton.

History of C :

Year of Establishment Language Name Developed By
1960 ALGOL-60 Cambridge University
1963 CPL (Combined Programming Language) Cambridge University
1967 BCPL (Basic Combined Programming Language) Martin Richard at Cambridge University
1970 B Ken Thompson at AT & T's Bell Laboratories.
1972 C Dennis Ritchie at AT & T' Bell Laboratory.

The development of C was a cause of evolution of programming languages like Algol 60, CPL (Combined Programming Langauge), BCPL (Basic Combined Programming Language) and B.

  • Algol-60 : (1963) : ALGOL is an acronym for Algorithmic Language. It was the first structured procedural programming language, developed in the late 1950s and once widely used in Europe. But it was too abstract and too general structured langauage.

  • CPL : (1963) : CPL is an acronym for Combined Programming Language. It was developed at Cambridge University.

  • BCPL : (1967) : BCPL is an acronym for Basic Combined Programming Language. It was developed by Martin Richards at Cambridge University in 1967. BCPL was not so powerful. So, it was failed.

  • B : (1970) : B language was developed by Ken Thompson at AT & T Bell Laboratories in 1970. It was machine dependent. So, it leads to specific problems.

  • C : (1972) : 'C' Programming Langauage was developed by Dennis Ritchie at AT & T Bell Laboratories in 1972. This is general purpose, compiled, structured programming langauage. Dennis Ritchie studied the BCPL, then improved and named it as 'C' which is the second letter of BCPL

The C language has following numorous features as:
  • Portability
  • Flexibility
  • Effectiveness and efficiency
  • Reliability
  • Interactivity

Execution of C Program :

C program executes in following 4 (four steps).
C program execution steps
  1. Creating a program :
  2. An editor like notepad or wordpad is used to create a C program. This file contains a source code which consists of executable code. The file should be saved as '*.c' extension only.

  3. Compiling the program :
  4. The next step is to compile the program. The code is compiled by using compiler. Compiler converts executable code to binary code i.e. object code.

  5. Linking a program to library :
  6. The object code of a program is linked with libraries that are needed for execution of a program. The linker is used to link the program with libraries. It creates a file with '*.exe' extension.

  7. Execution of program :
  8. The final executable file is then run by dos command prompt or by any other software.