3 ms·
Last time I checked, C++ used function pointers behind the scenes to achieve virtual method dispatch.
by cihangir 4y ago
Last time I checked, C++ used function pointers behind the scenes to achieve virtual method dispatch.
- kllrnohj 4y agoTypically the object contains a single pointer to the vtable which is then the list of function pointers. You can do this structure in C, but more common is the struct of function pointers which avoids a level of indirection at the cost of object size.