单项选择题
有下列程序,在横线添加;
#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.带链栈
点击查看答案
相关试题
下列程序中需要清理动态分配的数组,划线处...
设置虚基类的目的是解决二义性问题,通过用...
表达式“c3=c1.operator+(c2)”或...
虚函数必须是类的______。
在面向对象的程序设计中,将数据和处理数据...