11-11 继承

虚函数 多态

出现菱形继承,上两条表用虚拟继承,其他两条边随意
——————————————————————

#include
using namespace std;
class person 
{
public:
    int id;
};
class father:virtual public person   //
{
public:
    father(){id=30;}
    void money()
    {
        cout<<"money"<

——————————————————————————————————————

你可能感兴趣的:(11-11 继承)