UrbanPro
true

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How are C And C++ Different Form Each Other

Suprio Dutta
02/07/2018 0 0

1.C and C++ both have data types operator and conditional looping control statements.

But the difference is that C++ has to object-oriented concepts which C programs do not have. Hence C program is like the subset of C++ program.

2. Hence C is a procedural programming language, and C++ is object-oriented programing language.

2.C does not support functions, function overloading and operator overloading whereas C++ programs do.

3.C++ supports virtual and friend functions, whereas C has no support for virtual and friend functions.

4.C provides malloc() and calloc()functions for dynamic memory allocation, and free() for memory de-allocation, whereas C++ offers a new operator for memory allocation and delete operator for memory de-allocation.

5.C does not provide direct support for error handling (also called exception handling), C++ provides support for exception handling. Exceptions are used for "hard" errors that make the code incorrect.

6.C uses functions for input/output. For example, scanf and printf, whereas C++ uses objects for input-output. For example cin and cout.

7.C does not allow functions to be defined inside structures, whereas in C++, functions can be used inside a structure.

8.C does not support object-oriented programming; therefore it has no support for polymorphism, encapsulation, and inheritance, whereas, C++, being an object-oriented programming language, supports polymorphism, encapsulation, and inheritance.

0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Predict the Output of C Questions based on Recursion and Macro
#include<stdio.h>void k(unsigned int i,unsigned int j){ static char x="0123456789ABCDEF"; if(i>=j) k(i/j,j); putchar(x);}void main(){ k(20,12);} ___________________________________________ ...

Interview Questions
(1) What is the output of below program: For(char i = 0; i<256; i++)Printf(“%d\n”,i); Modify above program so that it can prints number from 0 to 255. (2) Consider on following declaration: (i)...

Tress And Its Traversal
Depth First Traversals:(a) Inorder (Left, Root, Right) : 4 2 5 1 3(b) Preorder (Root, Left, Right) : 1 2 4 5 3(c) Postorder (Left, Right, Root) : 4 5 2 3 1 Trees are one of the data structures like...

Do You Know Size Of Empty Class and Reason?
Size of empty class is always 1 byte. Reason is, in order to differentiate one object to another object, the size of empty class is always 1 byte. See the below c++ code snippet. Here there are three...

Definite book guides for C++
This post attempts to collect the few pearls among the dozens of bad C++ books. Unlike many other programming languages, which are often picked up on the go from tutorials found on the internet, only...
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more