How Abstractions Work in Programming

Diagram: vptr, vtable, Instances, Subclass & Superclass (2025)

Share
A diagram showing the relationship of the vptr of instances to the vtables of subclasses and superclasses. Each instance has a vptr pointer alongside its other fields. The vptr of a given instance points to a vtable of a class, be it a subclass or superclass. The superclass contains pointers to functions. The values of these pointers can be inherited from the superclass to the subclass. Only virtual methods are included in the vtable, non-virtual methods are not.

Description

A diagram showing the relationship between the vptr of instances and the vtable of classes on some Object Oriented Programming implementations, such as C++.

Metadada

File Type
image/webp
File Size
18.1KiB
Resolution
660x374px

View Comments