C++对象模型之五 构造 析构 赋值笔记[6]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 bigwhiteshark 的 blog

virtual float z(){return 0.0;}

 private:

  float _x, _y;

};

3虚继承下

class point3dpublic virtual point

{

 public

point3d ( float x = 0.0, float y=0.0, float z =0.0)point (x,y),_z(z){}

point3d( const poin3d& rhs)point(rhs),_z(rhs.z){}

~point3d();

point3d & operator = (const point3d &);

virtual float z() {return _z;}

protected:

float _z;

};

下面就是point3d的构造函数被扩充的内容

point3d *point3d::point3d( piont3d *this ,bool _most_derived,float x, float y, float z)

{

本文关键:C C++ VC BCB C++Builder C#
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top