Back to Browse

OOP #005 - Real World Example for using Polymorphism & Inheritance

199 views
Nov 14, 2023
6:46

Virtual table (Vtable): 1. https://en.wikipedia.org/wiki/Virtual_method_table 2. https://stackoverflow.com/questions/3554909/what-is-a-vtable-in-c V-tables (or virtual tables) are how most C++ implementations do polymorphism. For each concrete implementation of a class, there is a table of function pointers to all the virtual methods. A pointer to this table (called the virtual table) exists as a data member in all the objects. When one calls a virtual method, we lookup the object's v-table and call the appropriate derived class method.

Download

1 formats

Video Formats

360pmp48.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

OOP #005 - Real World Example for using Polymorphism & Inheritance | NatokHD