C++ Programming Language Easy Course

C++

C++ is a low level general purpose programming language, It was developed by Danish scientist Bjarne stroustrup as an extension of the C programming language.

Bjarne Stroustrup in his Lab
source : https://img.gfx.no/2582/2582098/Bjarne%20Stroustrup.1000x563.jpg


It has all the features of C language but Unlike C it is Not un Procedural Oriented Language it is an Object Oriented Programming Language that's why It is often called 'C with classes'.

Object Oriented Programming language(OOP)

Object Oriented Programming Languages are those Programming languages which uses the concept of 'Ojects'. These Objects contain Data in the form of  Attributes and Codes in the form of Methods or Behaviour.

For example : A person Has basic propertiese like Name, age and height these are called attributes and the behaviour of person includes walking, talking and doing any work.



Class

  • A Class is an user defined data type which contains data members and member functions.
  • It is declared by using 'Class' reserved keyword.
  • Data members are the variables and the Member functions are the functions performed by manipulating Data members.
  • Example :
Class class_name
{
    public:
        int a = 10;        //Data member
        int b = 20;        //Data member
        int c;                //Data member
        void sum()       //Member functions
        {
            c = a + b;
        }
};

Object

Object is the collection of data members and member functions. It is an instance of class.
When a class is declared, the memory is not allocated to the class but when an object is declared the memory is allocated to class.
It means that Objects are declared to intialize a Class.







Comments

Popular posts from this blog

A program to Add numbers divisible by 3 or 5 in C++

When only Some specific user name will be greeted in a C++ Program.