OBJECT-ORIENTED PROGRAMMING, DIFFERENCE BETWEEN C AND C++
*object oriented programming language is the type of programming language where programmer need to define both datatype and type of operation applied to that data structure.
*In simple words, the object contains both data and function.
Here are some of the key features of OOP,
- Abstraction: Object-Oriented Programming only displays essential feature of an application. Complete details are not displayed.
Eg: Vehicle is an abstraction, you can use for driven, horse riding and motor driving.
- Interface: Defines properties of abstraction.
Eg: For vehicles, the interface is camels, elephants.
- Inheritance: In this technique, the user can re-use the existing code again and again.
- Polymorphism: Allows executing same procedure differently.
Examples of OOP- C++, Java, PHP, C, Python.
Now let’s see the difference between the Procedural programming language and Object Oriented Programming language.
ABOVE IMAGE CREDITS::: http://practice.geeksforgeeks.org/problems/difference-between-procedural-language-and-object-oriented-language
If you want to execute something, you need to give step by step instructions manually to execute it.
Procedures are called as Subroutine, routine.
Object Oriented Programming language
Object component of the program knows how to program.
An Object is a logical person, which contains both data and procedure.
So, C++ is hybrid language, which has both procedural and object-oriented approach.
IMAGE CREDITS:: slideplayer.com
|C PROGRAMMING||C++ PROGRAMMING|
|Procedural does not support classes, object.||Both procedural and object|
|C is subset of C++||C++ is superset of C|
|Not support polymorphism, encapsulation, inheritance.||Supports all these properties.|
|Data and function are separate and both are free identity.||Data + Function=Object|
|Malloc(), calloc() used to allocate dynamic memory.
Free()—memory de allocation.
delete – memory de-allocation.
Other Knowledge sources where you can clear your concept,
YOU MIGHT LIKE THIS