A、Decr&operator--{int};
B、Decroperator--(Decr&,int);
C、friend Decr& cperator--(Decr&);
D、friend Decr operacor--(Decr&,int);
查看答案
正确答案
试题解析
解析:把“--”运算符重载为非成员(友元)函数格式:friend<返回类型>operator--()是前缀的格式;friend<返回类型>operator--(int)是后缀的格式。当然也可以有参数如题中C选项所示。