Wednesday 3 April 2013

OOP Concepts

The security level of c++ is very high as it provides three data visibility modes that is public, private and protected. whereas in C language we have one mode.

The data abstraction- The process of representing the data members and the member functions without showing the internal or the background details.

Encapsulation- It is the process of wrapping up of data members and member's functions into a single entity. For example data members and members functions are represented as encapsulated object.

Polymorphism- it is the ability to take more than one form. For example- if we want to add two numbers and both of them are integers then we have to do their addition and on the other hand if we have two strings then we can concatenate them. Both are used to perform same functions but produces different output.

Operator overloading- It is the process of accessing the data using the user defined variables.

Data hiding – The Insulation of the data members and member's functions is known as data hiding, as it is used to maintain more high security level.

Inheritance- It uses the concept of reusability in such a way that the features of base class is access by the derived class. It is of five types-
1. Single Inheritance
2. Hybrid inheritance
3. Multilevel inheritance
4. Multiple inheritance
5. Hierarchical Inheritance

Virtual functions- It is used to access the features of the derived base class when the name of the both the objects are same when we are carrying out the operation of the inheritance.


Blog Author: Vijay Kumar


Difference between C and C++

C is a structure oriented language where the code is organised in the form of blocks of codes that are executed to achieve the resultant output. The blocks of code can be functions, structure etc. It follows procedure paradigm.

Whereas, C++ is an object oriented language where the coding is done by using the user defined objects. Objects in turn are instances of class. Classes are based on the concept of data abstraction where all the related data and functions are grouped together and during execution instances of these classes called objects are used to refer to the data inside its respective class.

This is the main difference between C and C++. Apart from this other common differences are:


->C is Procedure Oriented Programming Language (POP).
->C++ is Object Oriented Programming Language (OOP).

->C is mostly used to develop system software.
->C++ is mostly used to modal real life problem to program and use to develop application programs.

->C program has extension .C
->C++ program has extension .cpp

->C uses the top-down approach.
->while C++ uses the bottom-up approach.

->C is function-driven.
->while C++ is object-driven.


We can use function inside structure in C++,but not in C.
C contains 32 Keywords,C++ extends it to 52 Keywords.
Data is not secured in C due to non-object oriented.
C++ supports function overloading while C does not.
The NAMESPACE feature in C++ is absent in case of C.
The standard input & output functions differ in the two languages.
C++ supports Exception Handling while C does not.