C++ Language


Name: C++ Language

Designed By : Bjarne Stroustrup

Designed At : AT&T Bell Laboratories in Murray Hill, New Jersery, USA

First Appeared in : 1983
Introduction:

         C++ is an object oriented programming language. Initially named “C with classes”, C++ was developed by Bjarne Stroustrup at AT&T Bell Laboratories in Murray Hill, New Jersey, USA in the early 1980s. C++ is a general purpose programming language. It has an imperative, object oriented and generic programming features, while also providing facilities for low level memory manipulation. C++ as an extension of C language provides an efficiency and flexibility similar to C and also high level features for program organization.

         In 1983, the name of the language was changed from C with Classes to C++. The ++ operator in the C language is an operator for incrementing a variable, which gives some insight into how Stroustrup regarded the language. Many new features were added around this time, the most notable of which are virtual functions, function overloading, references with the & symbol, the const keyword, and single-line comments using two forward slashes (which is a feature taken from the language BCPL).

History Of C++

          Stroustrup found that Simula had number of features that were very helpful for large software development, but the language was too slow for practical use, while BCPL was fast but too low level to be suitable for the development of large software.

         Being an admirer of Simula67 and a strong supporter of C, Stroustrup wanted to combine the best of both languages and create a more powerful language that could support object oriented programming features and still retain the power and elegance of C. The result was C++. C++ is an extension of C with a major addition construct features of Simula67. Since the class was a major addition to the original C language, Stroustrup called the new language “C with classes”. However later in 1983, the name was changed to C++.The idea of C++ comes from the C increment operator ++, thereby suggesting that C++ is an arguments (incremented) version of C.


Characteristics of C++ :
  1. As it supports Object Oriented Programming, emphasis is on objects rather than on a structured sequence of codes.

  2. It is suitable for Development of Reusable Software, thus reduces cost of software development.

  3. C++ is a portable programming language that can be compiled in almost any type of computer and operating system without making any changes.

  4. C++ is compatible with C language. Any code written in C can easily be included in a C++ program without making any change.

  5. C++ has huge Function Library.

  6. C++ can be used for developing System Software viz., operating system, compilers, editors and database.

  7. C++ is a Machine Independent Language.

  8. It contains number of features like inheritance, polymorphism, Data Abstraction, Data Encapsulation, Dynamic binding, operator overloading, function overloading etc.


Rules for writing a C++ program:

       Some rules which hold for all programs written in C++ language are as follow:
  1. The program is started by including header files mainly iostream.h and conio.h .

  2. Before main(), class is declared which includes its own data and functions.

  3. Within the main(), object is created for the class define at the starting of the program.

  4. All the functions of the classes are executed by the object within main() function using object name and function name.

  5. Use /*----------*/ for multiline comment and // for single line comment.

  6. The insertion or put to operator (<<) is used with predefined object cout to give the output on the screen and the extraction or get from operator (>>) is used with predefined object cin to get the input from the user.

Syntax:
#include <iostream.h>
#include <conio.h>
void main()
{
     cout<<"Hello World";
     getch();
}