Difference Between C and C++
C | C++ |
---|---|
1. C is Procedural Language. | 1. C++ is non Procedural i.e Object oriented Language. |
2. In C, Polymorphism is not possible. | 2. The concept of polymorphism is used in C++.Polymorphism is the most Important Feature of OOPS. |
3. Inheritance is not possible in C. | 3. Inheritance is possible in C++. |
4. Virtual Functions are not present in C. | 4. The concept of virtual Functions are used in C++. |
5. Operator overloading is not possible in C. | 5. Operator overloading is one of the greatest Feature of C++. |
6. Top-down approach is used in Program Design. | 6. Bottom-up approach adopted in Program Design. |
7. Multiple Declaration of global variables are allowed. | 7. Multiple Declaration of global varioables are not allowed. |
8. scanf() Function used for Input. printf() Function used for output. | 8. Cin>> Function used for Input. Cout<< Function used for output. |
9. Namespace Feature is not present in C. | 9. Namespace Feature is present in C++ for avoiding Name collision. |
10. In C, we can call main() Function through other Functions | 10. In C++, we cannot call main() Function through other functions. |
11. C requires all the variables to be defined at the starting of a scope. | 11. C++ allows the declaration of variable anywhere in the scope i.e at time of its First use. |
12. In C, malloc() and calloc() Functions are used for Memory Allocation and free() function for memory Deallocating. | 12. In C++, new and delete operators are used for Memory Allocating and Deallocating. |
13. C supports built-in and primitive data types. | 13. C++ support both built-in and user define data types. |
14. Mapping between Data and Function is difficult and complicated. | 14. Mapping between Data and Function can be used using Objects |
15. In C, Exception Handling is not present. | 15. In C++, Exception Handling feature us available. |
0 comments :
Post a Comment