You are on page 1of 3

C C++

1. C++ is non Procedural i.e Object oriented


1. C is Procedural Language.
Language.
2. The concept of virtual Functions are used in
2. No virtual Functions are present in C
C++.
3. The concept of polymorphism is used in C+
+.
3. In C, Polymorphism is not possible.
Polymorphism is the most Important Feature
of OOPS.
4. Operator overloading is one of the greatest
4. Operator overloading is not possible in C.
Feature of C++.
5. Bottom up approach adopted in Program
5. Top down approach is used in Program Design.
Design.
6. Namespace Feature is present in C++ for
6. No namespace Feature is present in C Language.
avoiding Name collision.
7. Multiple Declaration of global variables are 7. Multiple Declaration of global varioables are
allowed. not allowed.
8. In C 8. In C++

scanf() Function used for Input. Cin>> Function used for Input.

printf() Function used for output. Cout<< Function used for output.

9. Mapping between Data and Function is difficult 9. Mapping between Data and Function can be
and complicated. used using "Objects"
10. In C, we can call main() Function through other 10. In C++, we cannot call main() Function
Functions through other functions.
11. C++ allows the declaration of variable
11. C requires all the variables to be defined at the
anywhere in the scope i.e at time of its First
starting of a scope.
use.
12. No inheritance is possible in C. 12. Inheritance is possible in C++
13. In C, malloc() and calloc() Functions are used for
13.In C++, new and delete operators are used
Memory Allocation and free() function for memory
for Memory Allocating and Deallocating.
Deallocating.
14. It support both built-in and user define data
14. It supports built-in and primitive data types.
types.
15. In C++, Exception Handling is done with
15. In C, Exception Handling is not present.
Try and Catch block.
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 cant be accessed by external functions.
5
C follows 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 in the function.
Variables can be defined anywhere in the function.
8
In C, namespace feature is absent.
In C++, 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.