🧬 Inheritance & Runtime Polymorphism
Inheritance allows child classes to derive properties from a base class. Polymorphism allows treating derived objects through base class pointers using Virtual Functions (virtual).
🛠️ Virtual Tables (vtable) & Dynamic Binding
When a function is declared virtual, C++ creates a hidden VTable (Virtual Table) holding function pointers. Calling ptr->speak() resolves dynamically at runtime based on the actual object instance!
💻 Code Example: Polymorphic Game Entity Architecture
Microsoft Windows [Version 10.0.22631.3007] (Windows 11 Pro x86_64)
(c) Microsoft Corporation. All rights reserved.
C:\Users\Student>#include <iostream>
