【发布时间】:2013-09-17 02:09:15
【问题描述】:
假设:
struct A {
int a;
int b;
};
struct B {
int a;
int b;
int func() {
return this->a + this->b;
}
};
B 的实例是否包含指向 func 的指针?
用代码说明这个问题:
A a; // first 4 bytes are for `int a`, second 4 bytes are for `int b`
B b: // ditto, but is there an extra word for a pointer to function `func`?
【问题讨论】: