摘要: //*如果方法得到一个新的对象 考虑用构造函数去完成ep:vector Vector::operator + (const Vector & b) const{ return Vector(x+b.x,y+b.y); //返回一个构造函数实例} //*ctime包含time()原型 time(0)当前时间 //*rand()通过初始种子活的随机数 srand()可以覆盖默认种子 ... 阅读全文
posted @ 2007-02-18 21:23 Edward Xie 阅读(425) 评论(0) 推荐(0) 编辑
摘要: ///////////////////////////////////////////////////////////////////////////////* 友元函数在类申明中用friend前缀 函数定头不加 //*重载operator操作符 (argment-list)//*通常在重载#include "mytime.h" int main(){ using std::cout; usi... 阅读全文
posted @ 2007-02-18 01:15 Edward Xie 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 做了不一定赢不做就一定不会赢 阅读全文
posted @ 2007-02-18 01:06 Edward Xie 阅读(216) 评论(2) 推荐(0) 编辑