朱健康:农家子弟如何成为美国院士# Biology - 生物学
c*e
1 楼
#include
class A {
public: virtual ~A() {}
};
class B : public A {
public:
virtual void f() {}
};
Referring to the sample code above, on a typical platform that uses virtual
tables to implement virtual function lookup, what do you expect "sizeof(B)"
to be?
a) 4
b) sizeof(void *)
c) 2*sizeof(void *)
class A {
public: virtual ~A() {}
};
class B : public A {
public:
virtual void f() {}
};
Referring to the sample code above, on a typical platform that uses virtual
tables to implement virtual function lookup, what do you expect "sizeof(B)"
to be?
a) 4
b) sizeof(void *)
c) 2*sizeof(void *)