A. 运算符函数重载为类的成员函数时,第一操作数不出现在参数表中 B. 通过运算符重载不可能在C++中创建新的运算符 C. 赋值运算符可以重载为友元函数 D. 重载类型转换运算符时不需要声明返回类型
A. 运算符函数的名称总是以operator为前缀 B. 在表达式中使用重载的运算符相当于调用运算符重载函数 C. 运算符函数只能定义为类的成员函数 D. 运算符函数的参数可以是对象
A. myclass operator*(double,double); B. myclass operator*(double,myclass); C. myclass operator*(myclass,double); D. myclass operator*( myclass , myclass);
A. int operator-(FunNumber) B. FunNumber operator-() C. FunNumber operator-(int) D. int operator-- (FunNumber)
A. Numberoperator/(Number,Number); B. Numberoperator*(int); C. Numberoperator-(Number); D. Numberoperator+(Number,Number);
A. 1234 B. ******1234 C. **********1234 D. 1234******
A. 调用模版函数时,在一定条件下可以省略模板实参 B)可以用 int、double 这样的类型修饰符来声明模版参数 C. 模板声明中的关键字 class 都可以用关键字 typename 替代 D. 模板的形参表中可以有多个参数
A. template<typename T>T fun(T x){return x;} B. template<typename T>T fun(T x, int n){return x*n;} C. template<class T>T fun(T *p){return *p;} D. template<class T>T class A{T n;};
A. 模板参数可以作为数据成员的类型 B. 模板参数可以作为成员函数的返回值类型 C. 模板参数可以作为成员函数的参数类型 D. 模板参数不能作为成员函数的局部变量的类型