Summary
In this chapter, we concluded our exploration of topics in OOP, picking up from abstraction and moving on by showing the similarities between C and C++ regarding object-oriented concepts.
The following topics were discussed as part of this chapter:
- Abstract classes and interfaces were initially discussed. Using them, we can have an interface or a partially abstract class, which could be used to create concrete child classes with polymorphic and different behaviors.
- We then compared the output of the techniques we used in C to bring in some OOP features, with the output of what
g++
produces. This was to demonstrate how similar the results are. We concluded that the techniques that we employed can be very similar in their outcomes. - We discussed virtual tables in greater depth.
- We showed how pure virtual functions (which is a C++ concept but does have a C counterpart) can be used to declare virtual behaviors that have no default definition.
The next...