面向对象程序设计题(程序运行结果)有好的答案我加分
发布网友
发布时间:2022-05-27 12:53
我来回答
共1个回答
热心网友
时间:2023-10-23 18:56
1)
Constructing base class
Constructing base class
Constructing derived class
x=5
Destructing derived class
Destructing base class
Destructing base class
2)
Constructing base...
base1 a=5
base2 a=5
derived a=5
3)
The parent. version A
The derived1 info:3 version 1
The derived2 info:15 version A
The derived2 info:15 version A
4)
Line17:no appropriate default constructor available
可将第17行修改为:B(int a):A(a)
Line20:cannot access private member declared in class 'A'
可将第3行修改为:public:int x;
Line41:cannot access public member declared in class 'A'
可将第14行修改为class B:public A{