what is the main difference between c and c++?

Answers were Sorted based on User's Feedback



what is the main difference between c and c++?..

Answer / sushma sharma,hapur

These are the main difference of c and c++
*c follows the procedural programming paradigm while c++ is
a multi paradigm language.
*In case of C,the data is not secured while the data is
secured(hidden) in c++.
*C is a low level language while C++is a middle level language.
*C use the top down approach while C++ use the bottom up
approach.
*C is function-driven while is object driven.
*C++ supports functions overloading while C does not.
*we can use function inside structure in C++ but not in C.

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / deepak dahiya

C- language does not
have features of
Simula67 but C++
have features of
Simula67 like as
class.C++ have
advance facilities
which are
classes,inheritance,function
and operator
overloading,polymorphism
etc.

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / maxel

In C programming the concepts of overloading and overriding are unsupported.Where as in C++ overloading and overriding can be performed.

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / d.narmadha

c does not support the concept of inheritance but c++support
ineritance.

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / deepesh kumar prajapati

The main difference b/w c and c++ is that " extention in c
used .c but extention in c++ is used .cpp "

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / deepesh kumar prajapati

The main difference b/w c and c++ is that " in 'c' language
we declaration any variable after main () compulsory but in
c++ any variable declaration wherever "
for ex:-

in 'c' program eg.

#include<stdio.h>
void main()
{
int a,b;
printf("enter any no.=");
scanf("%d",&a);
b=a*a;
printf("square is=%d",b);
}


In c++ eg.


#include<iostream.h>
void main()
{
int a;
cout<<"enter any no";
cin>>a;
int b=a*a;
cout<<"square is="<<b;
}

note;-
both program is same (square any no.) only difference
is first program b is declare after main() an second program
b is declared after scan value.

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / krishna kumar

C++, as the name suggests is a superset of C. As a matter of fact, C++ can run most of C code while C cannot run C++ code. Here are the 10 major differences between C++ & C...
1. C follows the procedural programming paradigm while C++ is a multi-paradigmlanguage(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.
8. The NAMESPACE feature in C++ is absent in case of C
C++ uses NAMESPACE which avoid name collisions. For instance, two students enrolled in the same university cannot have the same roll number while two students in different universities might have the same roll number. The universities are two different namespace & hence contain the same roll number(identifier) but the same university(one namespace) cannot have two students with the same roll number(identifier)
9. The standard input & output functions differ in the two languages
C uses scanf & printf while C++ uses cin>> & cout<< as their respective input & output functions
10. C++ allows the use of reference variables while C does not
Reference variables allow two variable names to point to the same memory location. We cannot use these variables in C programming.

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / vinod

C++ support the exception handling while c does not support exception handling feature. c++ is a superset of c i.e. c++ can run most of c code while c can not run c++ code.
Data hiding future are not present in the c language while data hiding future are present in the c++ language this is oop future.
we can call the (Function) method throw the object in the c++, while in c object are not used.

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / pramananth.k

c is not object oriented .c++ is object oriented

Is This Answer Correct ?    0 Yes 0 No

what is the main difference between c and c++?..

Answer / priya

c++ is a middle level language where it understand both machine language and user defined language.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What do you mean by pure virtual functions?

8 Answers  


what is difference between class template and template class?

0 Answers  


Why do we use encapsulation in oops?

0 Answers  


What do you mean by binding of data and functions?

3 Answers  


Can bst contain duplicates?

0 Answers  






can you explain how to use JavaBean in Project

3 Answers   Infosys, Satyam,


I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?

3 Answers  


How do you answer polymorphism?

0 Answers  


What is a friend function & its advantage?

1 Answers   MIT,


What is a scope operator and tell me its functionality?

3 Answers   emc2,


What's the full form of STL?

2 Answers  


What are properties in oop?

0 Answers  


Categories