#ifndef MYTIME3_H_
#define MYTIME3_H_
#include
using namespace std;
class Time
{
private:
int hours;
int minutes;
public:
Time();
Time(int h,int m=0);
void AddMin(int m);
void AddHr(int h);
void Reset(int h=0,int m=0);
Time operator+(const Time & t) const;
friend Time operator+(const Time & t1,const Time & t2);
friend Time operator-(const Time & t1,const Time & t2);
friend Time operator*(double n,const Time & t);
friend ostream & operator<<(ostream & os,const Time & t);
};
这是项目的头文件,编译时提示内部编译错误,是什么原因?
关于重载运算符的友元函数的问题(VC)
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-