#include<iostream>
using namespace std;
class A{};
class B : public A{public: void fun(){}};
class C : public B{public: virtual void func(){} };
int main(){ cout << sizeof(A) << endl; cout << sizeof(B) << endl; cout << sizeof(C) << endl; system("pause"); return 0;}
dev-c++4.9.9.2输出结果为
1
1
4