what is the main difference between c and c++?
Answers were Sorted based on User's Feedback
Answer / ravneet dhillon
1.c supports build-in and primitive datatype whereas c++
supports both build-in and user-defined datatype.
2.no namespace are present in c. namespace are present in c++.
3.polymorphism is not possible in c.polymorphism is possible
in c++.
4.no virtual function are present in c.there are virtual
function in c++.
5.In c,we have to declare variables at the start.In c++ we
can declare variables at any point with in a block not just
at the begining.
6.operator overloading is not possible in c.operator
overloading is possible in c++.
7.c have no classes.c++ use classes.
8.multiple declaration of global variables are allowed in
c.multiple declarations of global variables are not allowed
in c++.
9.c supports top down parsing.c++ supports bottom of parsing.
10.in c we can call main() function through other
function.in c++ we can not call main() function through
other function
or
we can say main function could be recursive in c and it
can't be called recursively in c++.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / k.senthil
c program does not support the data hiding.but c++ support
the data hiding method.
c programs divide in to smaller program that is know as
function
c++ program divide in to samller program that is known as
object.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / rakesh
in c there is no OOPS concept,so there is no re-usability.
where as in C++ there is is a OOPS concept,so there is a
re-usability.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sonal
c++ is object language & c is object based language
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / bindu kango
c is a middle label language,while c++is a high label
language.c can't support all the function of c++ where as
c++ support all the function of c.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / akrita agarwal
Operator and function overloading
Operator and function overloading is not supported by C. If a function has a name, then that function can't use in the program again. But using C++, that is possible. You can use the same function name with different arguments.
Char string limit
C can only recognizes first 32 char of string. But C++ doesn't pose this type of limitation.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vivek kudari
C++ include private and public keys.But C doesn't.
C++ compiler can understand all the keywords that c compiler
understand.but reverse is not true.
| Is This Answer Correct ? | 1 Yes | 0 No |
#include <iostream> using namespace std; int main() { int a = 2; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][c[1][4]]; }
What are properties in oop?
What is polymorphism in oop example?
what is new operator in c++
Is abstract thinking intelligence?
Why do we use oop?
why c++ is a highlevel language
3 Answers Satyam, Tech Mahindra,
What is oops and its features?
Write an operator overloading program to Overload ‘>’ operator so as to find greater among two instances of the class.
what is the main difference between c and c++?
386 Answers AZTEC, B.Tech, CMC, College School Exams Tests, HCL, IBM, ITM, Khalsa Institute, Microsoft, Oracle, Sanjeevni Institute, TCS, Tech Mahindra, Wipro, ZeOmega,
What is DeadlyDiamondDeathProblem ?
What is destructor give example?