急求,,在线等,实现Time类的自增运算符重载

[复制链接]
查看11 | 回复1 | 2013-6-24 15:29:52 | 显示全部楼层 |阅读模式
我就把那个重载的函数写给你吧,time类本身你应该能写出来。在time 类中声明友元函数 friend time& operator ++ ( time&);
friend time& operator ++ ( time&,int);然后在类外定义time operator ++ (time& a){
a.second++;
return a;}time operator ++ (time& a,int){
time temp(a);
a.second++;
return temp...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行