How does C++ handle the virtual table in a multiple-inheritance scenario? 

  • Single table for all classes 
  • Separate tables for each base class 
  • A combination of both depending on visibility 
  • Virtual tables are not used
In C++, when a class inherits from multiple base classes, each base class will have its own virtual table. Thus, an object of the derived class will have separate virtual tables for each inherited class to handle dynamic dispatch for function calls, ensuring correct method resolution.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *