Use g++ -fdump-class-hierarchy
Vtable for base
base::_ZTV4base: 3u entries
0 (int (*)(...))0
4 (int (*)(...))(& _ZTI4base)
8 base::printmyname
Class base
size=8 align=4
base size=8 base align=4
base (0xb6dd9c30) 0
vptr=((& base::_ZTV4base) + 8u)
Vtable for derive1
derive1::_ZTV7derive1: 3u entries
0 (int (*)(...))0
4 (int (*)(...))(& _ZTI7derive1)
8 derive1::printmyname
Class derive1
size=12 align=4
base size=12 base align=4
derive1 (0xb6d6ca80) 0
vptr=((& derive1::_ZTV7derive1) + 8u)
base (0xb6dd9c6c) 0
primary-for derive1 (0xb6d6ca80)