Difference between C and C++ in tabular form with examples

C C++
C was developed by Dennis Ritchie in around 1969 at AT&T Bell Labs. C++ was developed by Bjarne Stroustrup in 1979.
C is procedural programming. C++ is known as hybrid language because C++ supports both procedural and object oriented programming paradigms.
C does not support the OOPs concept so it has no support for polymorphism, encapsulation, and inheritance. C++ has support for polymorphism, encapsulation, and inheritance as it is being an object-oriented programming language.
C is a subset of C++. C++ is a superset of C.
C in general known as function-driven language. On the other hand, C++ is known as object driven language.
C does not support encapsulation so data behave as a free entity and can be manipulated by outside code. On another hand in the case of C++ encapsulation hides the data to ensure that data structures and operators are used as intended.
Function and operator overloading is not supported in C. Function and operator overloading is supported by C++.
C contains 32 keywords. C++ contains 63 keywords.
Direct support for exception handling is not supported by C. Exception handling is supported by C++.
C does not support inheritance. C++ supports inheritance.
Header file used by C is stdio.h. Header file used by C++ is iostream.h.
Namespace features are not present inside the C. Namespace is used by C++, which avoid name collisions.

Post a Comment

0 Comments