Ads Top

Difference between C and C++ or C Vs C++

what are Difference between C and C++ or C Vs C++ programming

C++ is a superset of C and contains all the features of C language. Still there are some difference between C and C++. This article is about C vs C++ in which I have shared some main difference between C and C++ language.



Difference between C and C++ or C Vs C++ programming


S. No.CC++
1C is a structural or procedural programming language.C++ is an object oriented programming language.
2Emphasis is on procedure or steps to solve any problem.Emphasis is on objects rather than procedure.
3Functions are the fundamental building blocks.Objects are the fundamental building blocks.
4In C, the data is not secured.Data is hidden and can’t be accessed by external functions.
5C follows top down approach.C++ follows bottom up approach
6C uses scanf() and printf() function for standard input and output.C++ uses cin>> and cout<< for standard input and output.
7Variables must be defined at the beginning in the function.Variables can be defined anywhere in the function.
8In C, namespace feature is absent.In C++, namespace feature is present.
9C is a middle level language.C++ is a high level language.
10Programs are divided into modules and functions.Programs are divided into classes and functions.
11C 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.
12Features like function overloading and operator overloading is not present.C++ supports function overloading and operator overloading.
13C program file is saved with .C extension.C++ program file is saved with .CPP extension.

1 comment:

  1. Difference between c and c++

    The main difference between C and C++ is, C is the procedure oriented language and C++ is the object oriented language.

    ReplyDelete

Powered by Blogger.