Introduction to C and C++

Language is a way to express thought . It is a fundamental tool for doing work . Similarly , it is a necessity for computer too. Softwares are created in special languages that provide instruction to tell computer to what to do. Computer language is similar to human language in many ways. Their sentences also have their own syntaxes, and words that have their own precise meanings. Computer language is more exact and more limited then English.

As there is more than one language for human similarly there is more than one computer language. Generally , the various languages are described as low-level and high-level. The more a computer language resembles ordinary English, higher is its level. Lower level language are more difficult to work with , but they usually produce programs that are smaller and faster.

On the lowest level is machine language. This is a series of codes, represented by numbers (1&0),used to communicate directly with the internal instruction of the PC’s microprocessor . Assembly language is slightly higher level than machine language which uses simple command words to supply step by step instructions for the processor to carry out. At the highest level are languages such as C and C++ that allow programmers to write in words and terms that are more closely parallel to English.

C language was developed in 1972 at AT & T’s bell laboratories, USA by Dennis Ritchie and Brain Kernigham. Their objective was to develop a language having the virtues of high-level programming language with the efficiency of assembly language . For several years after its development the only standard for C was a book on C written by its developers. An ANSI standard for C was produced in 1989.

A new version of C, named C++, was developed by Bjrane Stroustroup at Bell labs in early 1980’s. The evolution of C++ continued during the next few years and first widely available implementation appeared in 1985. C++ is so called because ++ is an operator in C, which increments a numeric value by 1. Therefore , C language is incremented to its next level with C++. It contains all the elements of the basic C language but has been expanded to include numerous object oriented programming feature.

C and C++ are complied languages i.e. they uses a complier to translate the program in machine language. Complier is a program that is present on a disk and is loaded into RAM.

C is based on structured programming and was developed for writing operating systems and with its help UNIX operating system was developed in 1973. Even after its widespread usage for years ,it was found that programming had flaws and limitations . Thus C++ based on syntax of C in addition to structured programming supporting object oriented programming was created .

So before discussing C and C++ we will explore the meaning of structured or procedural programming and object oriented programming.

Structured or Procedural Programming
In this type of programming emphasis is laid on the procedure used to solve a problem or program rather than on the data which will use this program for computation. In this procedural programming, a problem is grouped into sub-problem and each sub-problem is further grouped into sub-sub-problem
And so on. Then each sub-problem is solved through an individual procedure or function combine together to form a single program. Its limitations arises when the program is used for operation on a particular set of data and a modification done to the data in any part of the program must be reflected in all other parts of the program which uses this data. This problem becomes more serious when many programmers work on different parts of the same program manipulating shared data.

Object Oriented Programming
It gives primary importance to data than the procedure and does not allow data to flow around the program .
The main feature of OOP language are-
1)Object and Classes.
2)Data Encapsulation.
3)Data Abstraction.
4)Inheritance.
5)Polymorphism.
[Explained as and when used].