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
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
How do you use inheritance in unity?
Can bst contain duplicates?
What is abstraction example?
Why do we use polymorphism?
What does it mean when someone says I oop?
What is difference between oop and pop?
#include
Where is pseudocode used?
What is for loop and its syntax?
What are two types of polymorphism?
What is the main feature of oop?
How do you answer polymorphism?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
What makes a language oop?