单项选择题
有如下程序:
#include<iostream>
using namespace std;
class TestClass
public:
TestClass()cout<<"default constructor\n";
TestClass(const TestClass &x)cout<<"copy constructor\n";
;
TestClass userCode(TestClass b)TestClass c(b);return c;
int main()
TestClass a,d;
cout<<"calling userCode()\a";
d=userCode(
A.;
ret
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
执行如下程序将输出( ): #include<iostream> using namespace std; class Base public: Base()cout<< BB ;fun(); void fun ()tout<< Brim ; ; class Derived:public Base public: Derived()cout<< DD ; void fun ()cout<< Dfun ; ; int main()Derived d;return 0;
A.DD
B.BBDfunDDDfun
C.BBBfunDD
D.DDBBBfun
点击查看答案&解析
单项选择题
以下模板定义: template<class T> T fun(T x,T y)return x*x+y*y; 下面对fun的调用中错误的是( )。
A.fun<int>(2,6.5)
B.fun(2,6.5)
C.fun<>(2,6)
D.fun(2,6)
点击查看答案&解析
相关试题
有如下程序; #include <iostream> u...
有如下程序: #include<iostream> #i...
下面的程序输出结果是( )。 #include...