what defference between c and c++ ?

Answer Posted / sunil s patil

1. C follows the procedural programming paradigm while C++
is a multi-paradigm language(procedural as well as object
oriented)

In case of C, importance is given to the steps or
procedure of the program while C++ focuses on the data
rather than the process.
Also, it is easier to implement/edit the code in case of
C++ for the same reason.

2. In case of C, the data is not secured while the data is
secured(hidden) in C++

This difference is due to specific OOP features like
Data Hiding which are not present in C.

3. C is a low-level language while C++ is a middle-level
language (Relatively, Please see the discussion at the end
of the post)

C is regarded as a low-level language(difficult
interpretation & less user friendly) while C++ has features
of both low-level(concentration on whats going on in the
machine hardware) & high-level languages(concentration on
the program itself) & hence is regarded as a middle-level
language.

4. C uses the top-down approach while C++ uses the bottom-up
approach

In case of C, the program is formulated step by step,
each step is processed into detail while in C++, the base
elements are first formulated which then are linked together
to give rise to larger systems.

5. C is function-driven while C++ is object-driven

Functions are the building blocks of a C program while
objects are building blocks of a C++ program.

6. C++ supports function overloading while C does not

Overloading means two functions having the same name in
the same program. This can be done only in C++ with the help
of Polymorphism(an OOP feature)

7. We can use functions inside structures in C++ but not in C.

In case of C++, functions can be used inside a structure
while structures cannot contain functions in C.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a function in c?

567


Can we use any name in place of argv and argc as command line arguments?

605


How can you read a directory in a C program?

647


What is action and transformation in spark?

589


Is there a built-in function in C that can be used for sorting data?

742






What is default value of global variable in c?

556


Write a program to print factorial of given number without using recursion?

563


What is the maximum length of an identifier?

657


How can I recover the file name given an open stream or file descriptor?

588


How the c program is executed?

624


What are structural members?

564


Explain the difference between structs and unions in c?

570


Why is c not oop?

533


What is the use of a ‘’ character?

580


What is the difference between break and continue?

602