题目内容

已知将运算符“+”和“*”作为类Complex的成员函数重载,设c1和c2是类Complex的对象,则表达式c1+c2*c1等价于()

A. c1.operator*(c2.operator+(c1))
B. c1.operator+(c2.operator*(c1))
C. c1.operator*(c1.operator+(c2))
D. c2.operator+(c1.operator*(c2))

查看答案
更多问题

有如下函数模板定义:template<typenamT1,typenamT2>TFun(Tnreturn*5.0;若要求以int型数据9作为函数实参调用该模板,并返回一个double型数据,则该调用应表示为()

A. FUN(9.
B. FUN<9>
C. FUN<double>(9)
D. FUN<9>(double)

在定义函数模板或类模板时,开头的保留字是()

A. typename
B. template
C. class
D. typedef

将前缀运算符“--”重载为非成员函数,下列原型中,能正确用于类中说明的是()

A. Deer&operator--(int);
B. Deeroperator--(Deer&,int);
C. friendDeer&operator--(Deer&);
D. friendDeeroperator--(Deer&,int);

下面程序中对一维坐标点类Point进行运算符重载编译和运行情况是()

A. 运行时输出1011
B. 运行时输出1111
C. 运行时输出1112
D. 编译有错

答案查题题库