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

Answer Posted / daisy golwala

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 ?    376 Yes 49 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is graphics

2013


What is solid in oops?

617


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

1643


Why do we need polymorphism in c#?

691


What is for loop and its syntax?

598






How can you overcome the diamond problem in inheritance?

772


How do you explain polymorphism?

597


What is encapsulation selenium?

555


What is the types of inheritance?

604


What is encapsulation in oops?

541


What is inheritance in oop?

605


Can we define a class within the interface?

555


What is abstraction in oops with example?

778


What causes polymorphism?

577


What are different oops concepts?

578