What is vftable in high programming languages?
I read something like it's the address of a virtual object structure, but this is a pretty messy information
Can someone please explain it?
What is vftable in high programming languages?
I read something like it's the address of a virtual object structure, but this is a pretty messy information
Can someone please explain it?
Vftable is not explicitly mentioned in the C++ standard, but most (if not all) implementations use it for virtual function implementation.
For each class with virtual functions the compiler creates an array of function poiners which are the pointers to the last overriden version of the virtual functions of that class. Then each object has a pointer to the vtable of its dynamic class.
See this question and its accepted answer for more illustrations
Virtual dispatch implementation details
It most likely stands for "Virtual Function Table", and is a mechanism used by some runtime implementations in order to allow virtual function dispatch.
Mainstream C++ implementations (GCC, Clang, MSVS) call it the
vtable
. C has no polymorphism. I could only speculate about other languages.Here's what Wikipedia says on the topic: