Difference between C & C++
Differences between C and C++.
C | C++ |
1】C support procedural oriented programming paradigm for code development. | 1】C++ supports both procedural and object oriented programming paradigm. |
2】C supports top down approach. | 2】C++ supports bottom top approach. |
3】When we compared to C++ ,c is a subset of C++ | 3】 C++ superset of c |
4】C does not support object oriented programming paradigm. Therefore it has no support for polymorphism encapsulation and inheritance . | 4】Baingan object oriented programming language c++ supports polymorphism encapsulation and inheritance. |
5】In C data and functions are separate entities therefore the mapping between functions is different and complex. | 5】In C++ data and functions are encapsulated together . Therefore the mapping between data and functions are easy. |
6】In c data free entities and can be manipulted by the outside code . This is because of C does not support information hiding. | 6】In C++ encapsulation hides the data to ensure that the data is used as inheritation. |
7】C ,begins a procedural programming ,it is a function driven language. | 7】C++, being an object oriented programming . It is an object driven language. |
8】C uses functions for input and output .For example scanf and printf. | 8】C++ uses of objects for input and output . For example cin and cout. |
9】C has no support of virtual and friend function. | 9】C++ supports a virtual and friend function |
10】C provide maclloc() and calloc() functions for dynamic memory allocation and free for memory deallocation. | 10】C++ provides new operator for memory allocation and delete operator for memory deallocation |
11】C obsen't provide support for error handling(Also call expectation handling) | 11】C++ provide support for exception handling. |
Comments