C++多继承

C++多继承
C++多继承reference

C++多继承
#include
using namespace std;

class A
{
public:
void setx(int a){x = a;}
int getx(){return x;}
private:
int x;
};

class B
{
public:
void setx(int a){x = a;}
int getx(){return x;}
private:
int x;
};

class C: public A, public B
{
public:
void setx(int a){x = a;}
int getx(){return x;}
private:
int x;
};

int main()
{
C te

C++多继承最先出现在Python成神之路

版权声明:
作者:Alex
链接:https://www.techfm.club/p/22130.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>