题库 软件开发 题目列表 看下面代码,关于运算符重载说法正确的有?class Time...
多选题
看下面代码,关于运算符重载说法正确的有?
class Time
{
private:
int minutes;
public:
Time operator+(const Time & t);
friend Time operator*(double clock,const Time &time);
};
A.

若 Time operator+(const Time & t)重载正确,那么 Time t1; auto time= 22+t1;是一个正确的使用。

B.

friend Time operator*(double clock,const Time &time),这个函数可以访问Time类的minutes变量

C.

friend Time operator*(double clock,const Time &time),这个函数是一个非成员函数

D.

friend Time operator*(double clock,const Time &time),这个函数传入的参数可以是3个

E.

"->"只能重载为类成员函数

题目信息
校招真题
-
正确率
0
评论
15
点击