网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

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

A ) Decr& operator --(int);

B ) Decr operator --( Decr&,int);

C ) friend Decr& operator --(Decr&);

D ) frlend Decr operator --(Decr&,int);


参考答案

更多 “ ( 14 )将前缀运算符 “ -- ” 重载为非成员函数,下列原型中,能正确用于类中说明的是A ) Decr operator --(int);B ) Decr operator --( Decr,int);C ) friend Decr operator --(Decr);D ) frlend Decr operator --(Decr,int); ” 相关考题
考题 若以非成员函数形式 , 为类 Bounce 重载 “ ! ” 运算符 , 其操作结果为一 bool 型数据 , 则该运算符重载函数的原型是 【 13 】 。

考题 ( 14 )下列有关运算符函数的描述中,错误的是A )运算符函数的名称总是以 operator 为前缀B )运算符函数的参数可以是对象C )运算符函数只能定义为类的成员函数D )在表达式中使用重载的运算符相当于调用运算符重载函数

考题 将前缀运算符“--”重载为非成员函数,下列原型中,能正确用于类中说明的是( )。A.Decroperator--{int};B.Decroperator--(Decr,int);C.friend Decr cperator--(Decr);D.friend Decr operacor--(Decr,int);

考题 下列关于运算符函数的描述中,错误的是A.运算符函数的名称总是以operator为前缀B.运算符函数的参数可以是对象C.运算符函数只能定义为类的成员函数D.在表达式中使用重载的运算符相当于调用运算符重载函数

考题 下列关于运算符函数的描述中,错误的是( )。A.运算符函数的名称总是以operator为前缀B.运算符函数的参数可以是对象C.运算符函数只能定义为类的成员函数D.在表达式中使用重载的运算符相当予调用运算符重载函数

考题 将前缀运算符“--”重载为非成员函数,下列原型中能正确用于类中说明的是( )。A.DeCroperator--(int);B.DeCr operator--(DeCr,int);C.friend DeCroperator--(DeCr);D.friend DeCr operator--(DeCr,int);

考题 将前缀运算符“一一”重载为非成员函数,下列原型中,能正确用于类中说明的是( )。A.Deeroperator一一{int};B.Decroperator一一(Decr,int);C.friendDeercperator一一(Deer);D.friendDeeroperacor一一(Deer,int);

考题 将前缀运算符“--”重载为非成员函数,下列原型中能正确用于类中说明的是( )。A.DeCr&operator--(int);B.DeCr operator--(DeCr&,int);C.friend DeCr&operator--(DeCr&);D.friend DeCr operator--(DeCr&,int);

考题 定义一个复数类complex, 重载运算符 “+”,使之能用于复数的加法运算,将运算符函数重载为成员函数;重载运算符 “-”,使之能用于复数的减法运算,将运算符函数重载为友元函数。编写主函数,测试运算符重载。