base class , inheritate class sizeof()
- by user1279988
why sizeof(X) is 4 and sizeof(Y) is 8?
and another question, in class X, only the int(i) count as sizeof() 4? member function does take any memory space?
Plz tell me, thanks!
class X {
int i;
public:
X() { i = 0; }
void set(int ii) { i = ii; }
int read() const { return i; }
int permute() { return i = i * 47; }
};
class Y :…