- C is procedural language and C++ is procedural and oop language.
- C does not support public, private way of data hiding C++ support while in C you can do some-type of implementation hiding by opaque data structure.
- C does not support namespace while C++.
- C does not have exception handling while c++ support it.
- C is not a OOP language so it does not support inheritance, encapsulation, polymorphism, virtual function ,operator overloading.
- C does not have constructor destructor concepts.
- C does not have RAII or smart Pointer mach.
- C does not have template.
- In C default linkage of const variable is external while in C++ it is internal linkage that’s why you can create array of const specific size. below code will work only in c++.
- const int size =10;
- int arr[size]
- C++ support inline function.
- C++ support different STL containers.
Difference between c and C++
Filed under C++, Uncategorized