Difference Between C and C++ Programming Languages

This is one of the most asked question in the Computer Science courses. If you have done a computer science, information technology or related courses, chances are that you’ve faced this question asking you to explain “major differences between C and C++ programming languages”. And of course, most of you would have listed several such differences. Let’s explore this important question and make a comprehensive list of differences between C and C++

Before, we get into a bit technical stuff let’s recap what are C and C++. Well, C is probably the most widely used computer programming language. C was originally developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. The reason why C has been so popular lies in the efficiency with which C converts into machine instructions. This efficiency has made the applications written in C super-fast.

A list of differences between C and C++ programming languages.
A list of differences between C and C++ programming languages.

Major differences between C and C++

Following table contains various points where C and C++ programming languages differ from each other.

# C C++
1 C is a procedural (aka structural) programming language. In addition to begin procedural, C++ is also an object oriented programming language.
 2 In C language, the solution is achieved through a sequence of procedures or steps. Therefore, C is a function driven language. C++ can model the whole solution in terms of objects and that makes the solution better organized. C++ is an object driven language.
 3 Concept of virtual functions is not present in C. C++ offers the facility of using virtual functions.
 4 Operator overloading is not possible in C. C++ allows operator overloading.
 5 Data in C functions is not secured. Data can be easily accessed by other external functions. All the data in C++ can be put inside objects. This provides better data security.
 6 C is a middle level language. C++ is a high level language.
SEE ALSO: Difference between C++ and Java
 7 C programs are divided into modules and procedures. C++ programs are divided into classes and functions.
 8 C programs use top-down approach. C++ programs use bottom-up approach.
 9 In C, the main() function can be called from other functions. In C++, the main() function can not be called from other functions. The program execution begins from main() function.
 10 C language does not provide the feature of namespace. Namespaces are available in C++.
 11 Exception handling is not easy in C. It has to be done by using other functions. C++ provides exception handling through Try and Catch block.
 12 Inheritance is not possible in C. Because C++ is an object oriented language, inheritance is possible.
 13 In C, all the variables must be declared at the beginning of a scope. C++ allows declaring variables anywhere within the scope. This allows us to declare a variable when we use it for the first time.
 14 In C, function overloading is not possible. Function overloading is to use two functions with the same name within a scope. Function overloading is possible in C++
 15 Standard Input in C is received through scanf() function whereas standard output is given through printf() function. C++ uses cin>> and cout>> as standard input and output functions respectively.
 16 C programs are saved in files with extension .c C++ programs are saved in files with extension .cpp
 17 Mapping between data and functions is difficult in C. In C++ data and functions are easily mapped through objects.
 18 In C, polymorphism is not possible. Being a fully object oriented language, C++ offers polymorphism.
 19 C supports only built-in data types. C++ supports both built-in and user-defined data types.

C++ is the object oriented and updated version of C language.Therefore, C++ not only shares a lot of C features but also provides new features, such as object-orientation. As a result, most of the C++ compilers can also compile C programs. Following Vann diagram shows how C and C++ share features and how different they are:

C++ contains almost all of C.
C++ contains almost all of C.

The following graph shows the usage of various programming languages between 2002 and 2015.

Comparison of usage of various programming languages during 2002 and 2015. Source: TIOBE index.
Comparison of usage of various programming languages during 2002 and 2015. Source: TIOBE index.

As you can see, the use C language has been more or less steady during last 14 years. In comparison, Java and C++ have been going out of favor.

In the end, there is a video by Satish B in which he explains how to switch from C to C++.

So, these are the major differences between C and C++ programming languages. Of course, there are lots of other differences as well, do let me know if you want me to include anything in the list. Thank you for using TechWelkin.

6 thoughts on “Difference Between C and C++ Programming Languages”

  1. MR. DIPTIRANJAN PANI is the IT Head of NIELIT

    Add following point also in C , C++ diffrence.
    As C++ working more with objects, we will get present object address using “this” pointer.But in C, it is not possible

  2. M.Satyendra kumar

    Add following point also in C , C++ diffrence.
    As C++ working more with objects, we will get present object address using “this” pointer.But in C, it is not possible

    1. It’s not that C is more “powerful” than C++ ; but there could be several reasons why somebody will use C instead of C++… And instead of me explaining it all here, please read this web page to know those reasons.

Leave a Comment

Your email address will not be published. Required fields are marked *