单项选择题

下列函数模板的定义中,合法的是
<上一题 目录 下一题>
热门 试题

单项选择题
有如下程序: #include <iostream> using namespace std; class test private: int a; public: test( )cout<< constructor <<endl; test(int
A.cout<<a<<endl;
test(const test &_test)
a=_test.a;
cout<<"copy constructor"<<endl;

~test()cout<<"destructor"<<endl;
;
int main( )
test A(3)
return 0;

程序的输出结果是A) 3
destructor
B.constructor
destructor
C.copy constructor
destructor
D.3
单项选择题
要定义数组A,使得其中每个元素的数据依次为3、9、4、8、0、0、0,错误的定义语句是
要定义数组A,使得其中每个元素的数据依次为3、9、4、8、0、0、0,错误的定义语句是
相关试题
  • 如果不使用多态机制,那么通过基类的指针虽...
  • 有如下程序: #include <iostream> u...
  • 有如下程序: #include<iostream> usi...
  • 有如下程序: #include <iostream> u...
  • 虚函数支持多态调用,一个基类的指针可以指...