what is the main difference between c and c++?
Answer Posted / er.rajeev yadav
here are some difference between c and c++ ---
1. C is a PROCEDURE oriented programming language.
-> C++ is a OBJECT oriented programming language.
2. We can do programming through STRUCTURE,but NOT with the
help of the CLASS.
-> We can do programming through CLASS in c++.
3. C is a LOW level language.
->C++ is a HIGH level language.
4. C is a TOP->BOTTOM programming approch.
->C++ is a BOTTOM->TOP programming approch.
5. C is a collection of FUNCTIONS.
-> C++ is a collection of FUNCTIONS and/or CLASS.
6. c language main focuses on PROCEDURES.
-> c++ programming main focuses on OBJECTS.
7. In C,DATA can be MOVE openly around in the system from
function to function.
-> In C++,DATA is HIDDEn.It can not be accessed by external
functions.
8.C can not support all the feature of the C++.while c++
support all the features of C.
9. C NEEDS FORMAT CHARACTERS for printing & scanning.
-> C++ DOES NOT REQUIRED FORMAT SPECIFIER for printing and
scanning variable.
10. C variables are DECLARED in declaration section.
-> C++ variables are DECLARED any where in the program.
11. In C,we use PRINTF() ,SCANF() as standard input/output
functions.
-> In C++,we can use COUT<< or CIN>> as standard
input/output function.
12. In C,you can NOT OVERLOAD a function.
-> In C++ ,you can OVERLOAD the operator as well as
functions.
13. C does NOT have NAMESPACE for avoid name collisions.
-> c++ has NAMESPACE feature.
14.C does NOT have REFERENCE variables.
-> In C++ ,REFERENCE variables are USED in functions.
15. In C,constants are defined as 'MACROS'.
-> We can make a use of 'CONST' TO declare a constant.
16.In C program , the MAIN() should NOT RETURN a value.
-> In C++,MAIN() should RETURN a value.
17. C does NOT SUPPORT DEFAULT arguments.
-> C++ PROVIDES DEFAULT argument concept.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What do you mean by abstraction?
What are the two different types of polymorphism?
Explain the advantages of inheritance.
What is the main purpose of inheritance law?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is encapsulation and abstraction? How are they implemented in C++?
What is meant by oops concept?
How do you explain polymorphism?
Why is polymorphism important in oop?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
What is the real time example of inheritance?
what is difference between class template and template class?
What is the advantage of oop over procedural language?
What is abstraction encapsulation?