#include<iostream>
using namespace std;
class parent1
{
public:
int a;
public:
virtual void f()
{
}
};
class parent2
{
public:
int a;
public:
void f()
{
}
};
int main()
{
cout << "sizeof(parent1) = " << sizeof(parent1) << endl; //结果为8
cout << "sizeof(parent2) = " << sizeof(parent2) << endl; //结果为4
return 0;
}