C is a mead level programming language developed in 1970 by an American computer scientist named Dennis Ritche .C supports 32 keywords . C is a procedural language supporingt structured programming .
C++ Is a high level programming language developed by Bjarne Bell in the 1980s . C++ is based on the C language with some extra features and capabilities. C++ is an object oriented programming language.
Difference between C and C++
c | c++ |
---|---|
C supports procedural programming | C++ supports both procedural and object oriented programming language |
C doesn’t support OOPS concept | C++ has support of for polymorphism , inheritance, abstract and encapsulation |
C is a subset of c++ | C++ is a superset of c |
C is a function driven language | C++ is a object driven language |
C doesn’t supports function and operator overloading | C++ supports function and operator overloading |
C contains 32 keywords | C++ contains 52 keywords |
C doesn’t support exception handling | C++ supports exception handling ,try and catch |
OOPS in C ++
The main objective of opps is to bind together the data and the functions that operate on them so that no other part of the code can access this data except this function.
Class
It is a user defined data type which holds its own data members and member functions which can be accessed and used by creating an instance of that class.
Object
When a class is defined no memory is allocated but when it is instantiated memory is allocated.
Properties of OOPS
encapsulation abstraction polymorphism and inheritance
Encapsulation : in in object oriented programming, encapsulation is is defined as binding together the data and the functions that manipulates them
Abstraction : abstraction means display only essential information and hiding the details
Polymorphism: in simple words , we can define polymorphism as the ability of a message to be displayed in more than one form.
Inheritance: the capability of a class to derived properties and characteristics from another class is called inheritance