Coupon Accepted Successfully!


Differences between C and C++

Some differences between C and C++ are as follows:
  1. C is a procedure/function-oriented language and C++ language is driven by a procedure/object.
  2. Data is not protected in C, whereas data is secured in C++. Data hiding concept is absent in C.
  3. C uses a top down approach while C++ uses a bottom up approach. The program is prepared step by step in C, and in C++ base elements are prepared first.
  4. In C, we cannot give the same name to two functions in a program, whereas due to the function overloading feature, the above concept is possible in C++. One can initialize a number of functions with the same name, but with different arguments. The polymorphism feature is built in C++, which supports this concept.
  5. C uses printf() and scanf() functions to write and read the data respectively, while C++ uses cout and cin objects for output and input operations, respectively. Further, the cout uses << (insertion operator) and cin uses >> ( extraction operator).
  6. C uses stdio.h file for input and output functions, whereas C++ uses iostream.h for these functions.
  7. Constructor and destructors are absent in C and the same are provided in C++.
  8. Inline functions are supported by C++, and the same are absent in C. Inline functions can be used as micros. They are stated by a word ‘inline’.

Test Your Skills Now!
Take a Quiz now
Reviewer Name