Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++vtable and vptr layoutSingle-choice MCQ

On a typical Itanium ABI implementation, a class with a single virtual function is laid out so the vptr sits at offset 0. Given the code below compiled with no optimization, what does `sizeof(Derived)` most likely equal on a 64-bit platform, and why?

struct Base { virtual void f(); int a; }; struct Derived : Base { int b; };