单项选择题
有如下程序:
#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
B.constructor
destructor
C.copyconstructor
Destructor
D.3
destructor
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
下列函数模板的定义中,合法的是( )。
A.template <typename T>T abs(T x)(return x<0 -x:x;
B.template class <T>T abs(T x)return x<0 -x:x;
C.template T <class T> abs(T x)return x<0 -x:x;
D.template T abs(T x)return x<0 -x:x;
点击查看答案
单项选择题
对于int *pa[5];的描述,( )是正确的。
A.pa是一个指向数组的指针,所指向的数组是5个int型元素
B.pa是一个指向某数组中第5个元素的指针,该元素是int型变量
C.pa[5]表示某个数组的第5个元素的值
D.pa是一个具有5个元素的指针数组,每个元素是一个int型指针
点击查看答案
相关试题
设有如下程序: #include <iostream.h...
有如下程序: #include <iostream> u...
有如下的程序: #include <cstring.h...
若有以下程序: #include <iostream>...
以下程序的输出结果是( )。 #include...