|
Answer» The main difference between C and C++ are provided in the table below: | C | C++ |
|---|
| C is a procedure-oriented programming language. | C++ is an object-oriented programming language. | | C does not support data hiding. | Data is hidden by encapsulation to ensure that data structures and OPERATORS are used as intended. | | C is a subset of C++ | C++ is a superset of C. | | FUNCTION and operator overloading are not SUPPORTED in C | Function and operator overloading is supported in C++ | | Namespace features are not present in C | Namespace is used by C++, which avoids name collisions. | | Functions can not be defined inside structures. | Functions can be defined inside structures. | | calloc() and malloc() functions are used for memory ALLOCATION and free() function is used for memory deallocation. | new operator is used for memory allocation and deletes operator is used for memory deallocation. |
|