Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

What is the difference Between C and C++?

What is the difference Between C and C++?


1 Answer
Alankritha Ammu

Following are some of the differences between C and C++.

  1. When compared to C++, C is a subset of C++. All valid C programs are valid C++ programs.
  2. C is a structural or procedural programming language, while C++ is an object oriented programming language.
  3. In C, Functions are the fundamental building blocks, while in C++, Objects are the fundamental building blocks.
  4. C doesn't have variable references, while C++ has variable references.
  5. C uses malloc and free for memory allocation while C++ uses new and delete for memory allocation.
  6. C does not provide direct support for error handling, while C++ supports exception handling that helps in error detection and smooth handling.
  7. C does not support function and operator overloading, while C++ supports both function and operator overloading.
  8. C doesn't support Generic programming, while templates in C++ allow to write generic programs.
  9. C doesn't support namespaces while C++ supports them.
Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.