-->
当前位置:首页 > 题库

重载operator+时,返回值的类型应当与形参类型一致。

Luz5年前 (2021-05-10)题库4356
重载operator+时,返回值的类型应当与形参类型一致。 比如以下程序中,operator+的返回值类型有错: class A { int x; public: A(int t=0):x(t){ } int operator+(const A& a1){ return x+a1.x; } }; ~@[](5)

答案:FALSE