The C++ programming language was created by Bjarne Stroustrup and his team at Bell Laboratories (AT&T, USA) to help implement simulation projects in an object-oriented and efficient way. The earliest versions, which were originally reffered to as "C with classes", date back to 1980. As the name C++ implies, C++ was derived from the C programming language and ++ is the increment operator in C.
As early as 1989 and ANSI Committee (American National Standard Institute) was founded to standardize the C++ programming language. The aim was to have as many compiler vendors and software developers as possible agree on a unified description of the language in order to avoid the confusion caused by a variety of dialects.
In 1998 the ISO (International Organization for Standardization) approved a standard for C++ (ISO/IEC 14882).
Characteristics of C++
- universally usable modular programs
- efficient, close to the machine programming
- portable programs for various platforms
- data abstraction, that is, the creation of classes to describe objects
- data encapsulation, for controlled access to object data
- inheritance, by creating derived classes (including multiple derived classes)
- polymorphism (Greek for multiform), that is, the implementation of instructions that can have varying effects during program execution.
Traditional Procedural Programming
- the programmer must ensure that data are initialized with suitable values before use and that suitable data are passed to a function when it is called
- if the data representation is changed, eg. if a record is extended, the corresponding functions must also be modified.
Objects
Advantages of OOP
- reduced susceptibility to errors : an object controls access to its own data. More specifically, an object can reject erroneous access attempts
- easy re-use : objects maintain themselves and can therefore be used as building blocks for other programs
- low maintenance requirement : an object type can modify its own internal data representation without requiring changes to the application
Basic structure of C++ program
#include <iostream>
using namespace std;
int main()
{
statements;
......................
......................
}
0 Comments