3.16 DIFFERENCE BETWEEN C and C++
The difference between C and C++ can be classified as major differences and minor differences.
3.16.1 Major differences
- The aggregate type struct is enhanced and a new type called class has been introduced. Variable of type class are called object. The class encapsulates data as well as functions. This helps in increasing reusability of code. However, the introduction of objects and classes introduce many new concepts such as inheritance, polymorphism (static and dynamic), all geared to promote reusability of code. A Major portion of text is devoted to these concepts of C++.
- Function and class template have been added. They increase the productivity of the programmer considerably.
3.16.2 Minor differences