Re:OOP in C
by cihangir on Sunday January 08, 2023 @09:58AM
(#34299604)
Last time I checked, C++ used function pointers behind the scenes to achieve virtual method dispatch.
[ Parent
| on HN ]
Typically 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.