`
blueclouds
  • 浏览: 375 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

求助????

阅读更多
#include <iostream>
#include <complex>
using namespace std;
class Base
{
public:
	Base(){cout<<"aaaaa"<<endl;	}
	~Base(){cout<<"aaaaa~"<<endl;	}
//virtual 	virtual void f(int){cout<<"aaaaaint"<<endl;	}
	void f(double){cout<<"aaaaadl"<<endl;	}
	void f0(int i=10){cout<<"aaaaa10"<<endl;	}
//	void f1(int i=10){cout<<"i=10"<<endl;}
};

class Derived : public Base
{
public:
	Derived(){cout<<"dddd"<<endl;	}
	~Derived(){cout<<"ddddd~"<<endl;	}
	void f(complex<double>){cout<<"complex<double>"<<endl;	}
	void f2(int i=20){cout<<"i=20"<<endl;}
};
class Cerived //: public Base
{
public:
	Cerived(){cout<<"dddd"<<endl;	}
	~Cerived(){cout<<"ddddd~"<<endl;	}
	 void foo(complex<double>){cout<<"complex<double>"<<endl;	}
	
};
class destruct: public Derived, public Cerived //,public Base 
{
public:
	void fdt(int i=20){cout<<"i=20"<<endl;}
	//int a;
};


以上代码执行
sizeof(destruct)的结果为1;
当把class destruct: public Derived, public Cerived //,public Base中的//去掉之后
sizeof(destruct)的结果为2;
那位高手碰到过类似的问题的?求解啊!!!!!
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics