有以下程序,在横线应添加()。#include<iostream>using namespace std;class TestClass{public:Tes

题目内容(请给出正确答案)
有以下程序,在横线应添加()。includeusing namespace std;class TestClass{public:Tes

有以下程序,在横线应添加( )。 #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() { TestClass 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;}

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
更多相关问题