Denizey - Blog details
img

Blog details

img

Difference between C and C++ in Tabular Form

In this tutorial, you will learn about the difference between C and C++ language i.e. C vs. C++. It is one of the most commonly asked questions in technical interviews.

C programming language was developed by Dennis Ritchie in the year 1972 while C++ programming language was developed by Barnes Stroustrup in the year 1983. C++ is a superset of C and contains all the features of the C language. Still, there are some differences between C and C++. Below I have shared the main differences between these two programming languages.
 

Difference between C and C++

S. No.
C
C++
1
C is a structural or procedural programming language.
C++ is an object oriented programming language.
2
Emphasis is on procedure or steps to solve any problem.
Emphasis is on objects rather than procedure.
3
Functions are the fundamental building blocks.
Objects are the fundamental building blocks.
4
In C, the data is not secured.
Data is hidden and can’t be accessed by external functions.
5
C follows a top-down approach.
C++ follows bottom-up approach
6
C uses scanf() and printf() function for standard input and output.
C++ uses cin>> and cout<< for standard input and output.
7
Variables must be defined at the beginning of the function. Modern C compilers such as GCC support the C99 and C11 standards, which allow you to declare a variable anywhere.
Variables can be defined anywhere in the function.
8
In C, The namespace feature is absent.
In C++, The namespace feature is present.
9
C is a middle level language.
C++ is a high level language.
10
Programs are divided into modules and functions.
Programs are divided into classes and functions.
11
C doesn’t support exception handling directly. Can be done by using some other functions.
C++ supports exception handling. Done by using try and catch block.
12
Features like function overloading and operator overloading is not present.
C++ supports function overloading and operator overloading.
13
C program file is saved with. C extension.
C++ program file is saved with .CPP extension.

Comments

Joanne Scott 4.5

Dec 21st 13.00 Brezil

Ut enim ad minim veniam, quis Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et nostrud exercitation ullamco laboris commodo consequat.

Helpful Comment Report

Rose Slater

Dec 22st 6.00 Brezil

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris commodo Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium laboriosam, nisi ut aliquid ex ea commodi consequatur consequat.

Comment

Edward 4

Dec 21st 16.35 UK

Ut enim ad minim veniam, quis Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et nostrud exercitation ullamco laboris commodo consequat.

Helpful Comment Report

Subscribe To Our Online letter

Stay updated and make the most of your online learning experience.