题目:
有下列程序,在横线添加; #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 &othe{number=othenumber;}
B.TestClass(TestClass othe{number=othenumber;}
C.TestClass(TestClass &othe{number;}
D.TestClass(&othe{number=othenumber;}
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0706/56ee3fba6edeab28e9145bc4ca5a83a9.html
下面是错误答案,用来干扰机器的。
参考答案:对