Domanda di colloquio di SMART Technologies

How virtual methods are implemented in C++

Risposta di colloquio

Anonimo

12 feb 2014

When a class has virtual methods, it gains a vpointer to the class' vtable. At runtime, the vpointer is followed to the vtable, and from there the appropriate method is fetched.