Wednesday 3 April 2013

Difference between C and C++

C is a structure oriented language where the code is organised in the form of blocks of codes that are executed to achieve the resultant output. The blocks of code can be functions, structure etc. It follows procedure paradigm.

Whereas, C++ is an object oriented language where the coding is done by using the user defined objects. Objects in turn are instances of class. Classes are based on the concept of data abstraction where all the related data and functions are grouped together and during execution instances of these classes called objects are used to refer to the data inside its respective class.

This is the main difference between C and C++. Apart from this other common differences are:


->C is Procedure Oriented Programming Language (POP).
->C++ is Object Oriented Programming Language (OOP).

->C is mostly used to develop system software.
->C++ is mostly used to modal real life problem to program and use to develop application programs.

->C program has extension .C
->C++ program has extension .cpp

->C uses the top-down approach.
->while C++ uses the bottom-up approach.

->C is function-driven.
->while C++ is object-driven.


We can use function inside structure in C++,but not in C.
C contains 32 Keywords,C++ extends it to 52 Keywords.
Data is not secured in C due to non-object oriented.
C++ supports function overloading while C does not.
The NAMESPACE feature in C++ is absent in case of C.
The standard input & output functions differ in the two languages.
C++ supports Exception Handling while C does not.




No comments:

Post a Comment