单项选择题
有下列程序,在横线添加;
#include<iostream>
using namespace std;
class TestClass
public:
TestClass(int n)number=n;
______//拷贝构造函数
~TestClass()
private:
int number;
;
TestClass fun(TestClass p)
TestClass temp(P);
return temp;
int main()
TestClsss obj1(10),obj2(0);
TestClass obj3(obj1);
obj2=fun(obj3);
return 0;
A) TestClass(TestClass &other)number=other.number;
B) TestClass(TestClass other)number=other.number;
C) TestClass(TestClass &other)number;
D) TestClass(&other)number=other.number;
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
数据独立性是数据库技术的重要特点之一。所谓数据独立性是指()
A.数据与程序独立存放
B.不同的数据被存放在不同的文件中
C.不同的数据只能被对应的应用程序所使用
D.以上3种说法都不对
点击查看答案&解析
单项选择题
下列数据结构中,属于非线性结构的是( )。
A.循环队列
B.带链队列
C.二叉树
D.带链栈
点击查看答案
相关试题
若执行下面的程序时,从键盘上输入5和2,...
语句ofstream f( SALARY.DAT ,ios∷a...
以下for语句中不是死循环的是( )。
下列是模板声明的开始部分,其中正确的是
下列关于this指针的叙述中,正确的是