正在加载图片...
9.1.3 Constructor with parameters /求长方柱的体积 #include <iostream> using namespace std; class Box public: Box(int,int,int); //the declaration of constructor int volume(); private: int height; int width; int length; //define constructor outside of the class Box:Box(int h,int w,int len)//the realization of constructor { height=h; width-w; length=len; 2017年4月26日12时 第9章关于类和对象的进一步讨 9 H0务 论 BACK NEXTHOME2017年4月26日12时 15分 第9章 关于类和对象的进一步讨 论 9 //求长方柱的体积 #include <iostream> using namespace std; class Box {public: Box(int, int, int); //the declaration of constructor int volume( ); private: int height; int width; int length; };//define constructor outside of the class Box::Box(int h,int w,int len) //the realization of constructor { height=h; width=w; length=len; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有