请编写应用程序,它由三个类定义组成,类名分别为A、B和Test
发布网友
发布时间:2022-04-26 04:52
我来回答
共1个回答
热心网友
时间:2022-06-20 21:44
class A
{
public:
A:f(vf)(float vf) {}
int setk(BYTE in)
{
k = in;
return 0;
}
BYTE getk(BYTE *out)
{
return *out = k;
}
public:
float f;
private:
BYTE k;
};
class B:public A
{
public:
B:b(vb),f(vf)(float vf, bool vb) {}
public:
bool b;
};
class Test
{
public:
Test:n(dn)(float vf, BYTE vk, bool vb, int dn = 123)
{
x = new B(vf, vb);
}
~Test()
{
delete x;
}
public:
int n;
B *x;
};