#include <iostream>
using namespace std;
class father
{
public:
father(father& c)
:x(c.x),y(c.y){}
private:
int x;
int y;
};
class son
{
public:
son(father& c)
:father(c),z(0){}
private:
int z;
};
C++中用父类对象初始化子类的父类部分
最新推荐文章于 2024-07-30 21:43:27 发布