News for hackers. Stuff that matters.
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.
Re:OOP in C by kllrnohj on Sunday January 08, 2023 @02:09PM (#34302035)
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.