Difference Between C and C++ Programming Language – C Vs C++

Difference Between C and C++

C language is an imperative programming language like portable assembly language. And C++ is a multi paradigm language that supports imperative, generic, declarative and functional programming.

The C programming language was developed by Dennis Ritchie in 1972 at bell laboratories. While C++ programming language was developed by Bjarne Stroustrup in 1983.

The one of the most difference between C and C++ programming language is that C is a procedural programming language and C++ is an object oriented programming language.

C++ is a superset of C. The C++ can run most of the program of C while C cannot run C++ program.

In C programming language variable declaration done at the top of the program. But in C++ we can declare a variable anywhere in the program. The major difference between C and C++ programming language given below in table form.

C Vs C++ Programming Language

C Programming Language C++ Programming Language
C is a procedural programming language developed by Dennis Ritchie. C++ is an object oriented programming language developed by Bjarne Stroustrup.
C language focus on a procedure to solve any problem. C++ language focus on object and classes rather than procedure.
Programs are divided into functions and module. Programs are divided into classes and function.
C language follows a top-down approach. C++ follows a bottom-up approach.
The main() method can be called through other functions. The main() method can not be called through other functions.
C does not support OOP concepts such as object, class, inheritance, data hiding, polymorphism, etc. C++ supports object oriented programming concept.
The mapping between function and data is very complicated. The mapping between function and data can be done with the help of Objects.
C does not support inline function. C++ support inline function.
The concept of function overloading and overriding is not available. C++ provide support for function overloading and overriding.
It does not support exception handling. It supports exception handling with the help of try, catch and finally blocks.
C program file extension is .c C++ program file extension is .cpp
It uses calloc(), malloc(), free() function for allocate and deallocate memory. It uses new and deletes operator for allocating and deallocate memory.
A feature of a namespace is not available. A feature of a namespace is available.
It does not support reference variable and virtual function. It supports both reference variable and virtual function.
Declare variable at the top of the program. Declare variable anywhere in the program.
It uses printf() and scanf() function fot input and output. It uses cin>> and cout<< function for input and output.
C is a middle-level programming language. C++ is a high-level programming language.
The data is not more secure. Data is fully secure by an external function.

 

Categories: Java Tutorial

Leave a Reply

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