I am somewhat new to coding so I don't know very much about compilers and such but I know that the C++ compiler implements a virtual table at runtime so it can dynamically call functions. I am curious as to how this ability was actually implemented. Is it inherent to the compiler or is it a type of program one can tell the compiler to run upon encountering virtual functions? And how might I create such runtime programs for my own use?
Even if it would be impossible to do without creating my own compiler, any explanations to help me understand how the whole system works are greatly appreciated.