Files
developer-roadmap/roadmaps/cpp/content/virtual-tables@s99ImazcwCgAESxZd8ksa.md

725 B

Virtual Tables

Virtual tables (vtables) are compiler-generated lookup tables used in C++ to implement dynamic polymorphism, especially with virtual functions. Each class that declares or inherits virtual functions has a vtable, which contains pointers to the most derived versions of those virtual functions for that class. When a virtual function is called through a pointer or reference to a base class, the vtable is consulted at runtime to determine the actual function to execute based on the object's dynamic type.

Visit the following resources to learn more: