04 2013 档案

使用静态成员函数 统计学生成绩
摘要://统计学生平均成绩#include using namespace std;class Student{public: Student(int n,int a,int s):num(n),age(a),score(s){} void total(); static float average();... 阅读全文
posted @ 2013-04-27 19:03 程序+爱=人生 阅读(276) 评论(0) 推荐(0) 编辑
对象的引用的变形——&t->*t
摘要:#include using namespace std;class Time{public: Time(int,int,int); int hour; int minute; int sec;};Time::Time(int h,int m,int s){ hour=h; minute=m; se... 阅读全文
posted @ 2013-04-27 18:24 程序+爱=人生 阅读(102) 评论(0) 推荐(0) 编辑
对象的引用
摘要:#include using namespace std;class Time{public: Time(int,int,int); int hour; int minute; int sec;};Time::Time(int h,int m,int s){ hour=h; minute=m; se... 阅读全文
posted @ 2013-04-27 18:22 程序+爱=人生 阅读(102) 评论(0) 推荐(0) 编辑
尝试有关对象指针的使用方法,里面有自己加的知识,更深入了解了
摘要:#include using namespace std;class Time{public: Time(int,int,int);//声明结构成员函数 int hour; int minute; int sec; void get_time();};Time::Time(int h,int m,i... 阅读全文
posted @ 2013-04-22 19:22 程序+爱=人生 阅读(158) 评论(0) 推荐(0) 编辑
对象数组的使用及this指针(自己改的,虽然只是一小点,但是还是有成就感)
摘要:#include using namespace std;class Box{public: Box(int h=10,int w=12,int len=15):height(h),width(w),length(len){}//声明有默认参数的构造函数,参数初始化表初始化数据成员 int volu... 阅读全文
posted @ 2013-04-22 18:54 程序+爱=人生 阅读(132) 评论(0) 推荐(0) 编辑
我的正整数——数据成员
摘要:#include#includeusing namespace std;class NaturalNumber{private:int n;public:void setValue (int x);//置数据成员n的值,要求判断是否是正整数int getValue(); //返回私有数据成员n的值b... 阅读全文
posted @ 2013-04-10 19:30 程序+爱=人生 阅读(90) 评论(0) 推荐(0) 编辑

 
点击右上角即可分享
微信分享提示