t*****e 发帖数: 53 | 1 class B : virtual public A {}
class C : virtual public A {}
class D : public B, C {}
all the classes have virtual member function.
Q: how many virtual table pointers does class D have? why? | H*M 发帖数: 1268 | 2 不是很确定,但是intuitively没有理由有多个vptr啊
【在 t*****e 的大作中提到】 : class B : virtual public A {} : class C : virtual public A {} : class D : public B, C {} : all the classes have virtual member function. : Q: how many virtual table pointers does class D have? why?
| l*******r 发帖数: 511 | 3 1?
【在 t*****e 的大作中提到】 : class B : virtual public A {} : class C : virtual public A {} : class D : public B, C {} : all the classes have virtual member function. : Q: how many virtual table pointers does class D have? why?
| x***y 发帖数: 633 | 4 3, each of B, C, D part of a D object has vtptr and a corresponding vtable,
which stores the offset and some other values... | l***i 发帖数: 1309 | |
|