Difference between c and C++

  1. C is procedural language and C++ is procedural and oop language.
  2. 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.
  3. C does not support namespace while C++.
  4. C does not have exception handling while c++ support it.
  5. C is not a OOP language so it does not support  inheritance, encapsulation, polymorphism, virtual function ,operator overloading.
  6. C does not have constructor destructor concepts.
  7. C does not have RAII or smart Pointer mach.
  8. C does not have template.
  9. 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++.
    1. const int size =10;
    2. int arr[size]
  10. C++ support inline function.
  11. C++ support different STL containers.

Leave a comment

Filed under C++, Uncategorized

Leave a comment