
Turbo C++
---------
  C++, originally known as 'C with classes', was developed at
AT&T Bell Laboratories in the early 1980's by Bjarne Stroustrup. Two
Languages contributed to its design. They are C which provided
low-level features and Simila67, which provided the class concept.


In Early day programming is mainly concerned for the calculation
purpose. They are not even procedural oriented.

Example : BASIC,COBOL etc.

Limitations
-----------

1. There were no facilities to reuse exisiting program code.
   Wherever the same piece code was required, it was simply duplicated.

2. The control was tranferred using goto statement.
   This will affect the sequence of the program.

3. All variable in the program are global.
    Memory will be wasted

4. Writing, understanding and maintaining long programs became
   very tedious job for the programmer's.

Structured Programming
----------------------

 To overcome the limitation which is above mentioned.
 Programmers developed the languages called Procedural or Structured
 Oriented Programming.

 Advantages Of Structured Programming
 ------------------------------------
 1. This allow the program to be splitted up into groups called
    fuction, and which is used for reusability concept.

 2. This allows the programmer to decide the variable whether
    Local or global, this saves some amount of memory.

 3. Datatypes gave a new dimension to the variable.

 4. A new concept called Abstraction came into existence.
    In Structured program , for user it is enough to know which
    task is performed by which function. This is called functional
    abstraction.


 Limitation
 ----------
1. There was no data security because any function can allow access
   any data.

2. There was no way of hiding or abstracting the data.

3. All the method or function are global

4. In a structured program, data types are processed in many
   functions and when changes occur in data types, modification
   must be made at every location that acts on those data types
   within the program. This is a time-consuming task for the
   large programs.

5. Structure programming don't model the real world very well.


Object-Oriented Approach
------------------------
  The fundamental idea behind an object-oriented language is to
combine into a single unit both data and the function that operate
on the data. Such a unit is called an object.

An object's function provides the only way to access the data.
Thus the data is hidden and is safe from accidental alteration.
Data and function are encapsulated into a single entity.
This concept is called Data Encapsulation.

The function of an object are called the member function
or methods in C++.

The data of an object are called the member data.

Class
-----
Class is a template to define the data and functions.
 - User defined datatypes
 - It is like a container contains data and function.

 Syntax
 ------
 class <class name>
 {
  variable1;
  ..
  variable n;
  function();
  }


Object
------
Combining into single unit both the data and function that
operate on the data is called an Object.

Concept of OOPS
---------------

 - Data Encapulation
 - Data Abstraction or Data Hidding
 - Inheritance
 - Polymorphism


Definition
----------

Data Encapulation
-----------------
Binding the function and data together and the function
acting on the data

Data Abstraction
----------------
User knows that the operation can be done on data but doesn't
know about the internal structure of the data

Example : swithbox,carbreak

Inheritance
-----------
Inheritance is the process of creating a new class called the
derived class, from the existing class, called base class.

Getting the properties from one class to another class. It
is used for reusability concept.

Polymorphism
------------
The word polymorphism is derived from two Latin words
Poly(many) and morphos(forms).The concept of using function
in different ways, depending on what they are operating on, is
called polymorphism

Specific action is determined by the exact nature of
situation


Constructors
------------
Constructor is syntactically similar to the function but
it should have the name of the class. Whenever we creating an
object constructor is automatically created.

Destructors
-----------
Destructors are functions that are complimentary to constructors.
They de-initialize object when they are destroyed.

Access Specifiers
-----------------
The body of the class contains two keywords:
1. Private

2. Public

The keywords private and public are called access specifiers.
The primary mechanism used to incorporate data hiding in C++
is by using the private keyword. Private data or functions can
only be accessed from within the class. Public data or function,
on the other hand are accessible outside the class.

Program Examples
----------------
1.
 //To Print a Message
 #include<iostream.h>
 void main()
 {
  cout<<"Hello World";
  }


2.
class sample
{
 int a,b,c;

 public:
  void getdata()
  {
   cin>>a;
   cin>>b;
   c=a+b;
   cout>>c;
  }
 };

main()
{
 sample s;
 s.getdata();
 }

 

                                                   
