摘要:
1. 语法返回类型 类名::operator 操作符(形参表){ 函数体代码;}2. 实例#include #include using namespace std;class StopWatch{public: StopWatch();//构造函数 void setTime(int newMin,int newSec);//设置秒表时间 StopWatch operator - (StopWatch&);//计算两个秒表的时间 void showTime();private: int min; int sec;};StopWatch::StopWat... 阅读全文
posted @ 2014-02-25 19:39
那个人-
阅读(954)
评论(0)
推荐(0)