单项选择题

下列是模板声明的开始部分,其中正确的是______ 。

A.template<T>
B.template <class T1,T2>
C.template <class T1,class T2>
D.template <class T1;class T2>
<上一题 目录 下一题>
热门 试题

单项选择题
有以下类定义: class Point public: Point(int x=0,int y=0)_x=x; _y=y; void Move(int x Off, int y Off) _x+=x Off; _y+=y Off; void Print() const cout <<’(’ << _x << ’,’ << _y << ’)’<< end 1; private: int _x,_y;下列语句中会发生编译错误的是______。
A.Point pt; pr. Print();
B.const Point pt; pt. Print();
C.Point pt; pt. Move(1,2);
D.const Point pt; pt. Move(1,2);
单项选择题
有以下程序: #include <iostream> using namespace std; class Complex public: Complex(double r=0,double i=0):re(r),im(i) double zeal() const return re; double imag() const return im; Complex operator+(Complex c) const return Complex(re+c.re,im+c.im); private: double re,im; ; int main() Complex a=Complex(1,1)+Complex(5); cout<<a.real()<<’+’<<a.imag()<<’i’<<end 1; return 0;程序执行后的输出结果是______。
A.6+6i
B.6+1i
C.1+6i
D.1+1i
相关试题
  • 下列程序输出结果是 【13】 。 includ...
  • 下列程序的输出结果是 【15】 。 #in...
  • 下面是用来计算n的阶乘的递归函数,请将该...
  • 与成员访问表达式p→name 等价的表达式是...
  • 下列程序的输出结果是 【11】 。 #in...