求sizeof()输出结果!!
class CObject
{
public:
long ID;
CObject *pOb;
virtual long GetID(){return ID;}
};
class CMyObject:public CObject
{
long myID;
long GetID(){return myID;}
static long nRef;
};
long CMyObject::nRef=0;
#include<iostream.h>
void main()
{
CObject *p=new CMyObject;
cout<<sizeof(CObject)<<"\n";
cout<<sizeof(CMyObject)<<"\n";
cout<<sizeof(p)<<"\n";
cout<<sizeof(*p)<<"\n";
delete p;
} //结果是多少?请我详解一下了,谢谢。