前缀自增运算符用成员函数方式重载时,其参数个数为0,用友元函数重载时,其参数个数为1。()
A.错误
B.正确
A.错误
B.正确
第1题
A.除了后增后减单目运算符外,其他运算符重载为类的成员函数时,函数参数个数比运算符实际操作数个数少一个
B.运算符重载为类的成员函数时,函数中的this指针指向第一个运算数
C.只有运算符的第一个运算数是自定义类类型时,才能将该运算符重载为类的成员函数
D.所有运算符都可以以类成员函数形式进行重载
第2题
A.赋值运算符和下标运算符只能重载为类的成员函数
B.赋值运算符和下标运算符只能重载为类的友元函数
C.赋值运算符重载时一般以引用方式返回*this,表示返回赋值运算符的左操作数
D.使用重载的赋值运算符时,左操作数一定是自定义类型
第3题
A.正确
B.错误
第5题
A.operator+有两个参数,operator*有两个参数
B.operator+有两个参数,operator*有一个参数
C.operator+有一个参数,operator*有两个参数
D.operator+有一个参数,operator*有一个参数
第6题
A.myclassoperator++()
B.myclass& operator++()
C.myclassoperatorint++(int)
D.myclass& operator++(int)
第8题
A.Value operator+(Value v,int i);
B.Value operator+(Value v=value,int i);
C.Value operator+(Value vint i=0);
D.Value operator+(Value v=value,int i=0);
第10题
A.为类重载new运算符
B.为类添加析构函数,在析构函数中释放资源
C.为类添加delete运算符
D.为实现IDisposable借口