mytime.h
来自「我学习C++ Primer Plus过程中写下的课后作业的编程代码」· C头文件 代码 · 共 24 行
H
24 行
// mytime.h -- Time class with friends
#ifndef MYTIME_H_
#define MYTIME_H_
#include <iostream>
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 );
friend Time operator + ( const Time & t1, const Time & t2 );// 加const后不行了
friend Time operator - ( const Time & t1, const Time & t2 );
friend Time operator * ( const Time & t, double n );
friend Time operator * ( double n , const Time & t );
friend std::ostream & operator << ( std::ostream & os, const Time & t );
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?