2011年6月9日

对象数组

摘要: #include<iostream>#include<string>#include<cstdlib>using namespace std;class Box{ public: Box(int h=10,int w=12,int len=15): height(h),width(w),length(len){} int volume(); private: int height; int wid... 阅读全文

posted @ 2011-06-09 12:46 more think, more gains 阅读(156) 评论(0) 推荐(0) 编辑

析构函数

摘要: #include<iostream>#include<string>#include<cstdlib>using namespace std;class student{ public: //定义构造函数,带参数的构造函数 //方法1 /* student(int n,string nam,char s) { num=n; name=nam; sex=s; cout<<"Constructor c... 阅读全文

posted @ 2011-06-09 12:25 more think, more gains 阅读(234) 评论(0) 推荐(0) 编辑

导航