Regarding polymorphism - I'm not sure, but virtual functions in C++ are realized through tables of pointers to "callback" functions of methods. These pointers are filled out during object creation. In C you can go the same way - use pointers to functions as members of structure of base class.
Different interfaces to inherited class (multiple base classes with virtual functions) can be realized using multiple sets of pointers to implementation functions. So, if you want to use multiple interfaces, access these tables not directly, but through pointers to each base class layout, located at very begin of the inherited class layout.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.