C++ 虚继承 多重继承

2014-11-24 07:11:03 · 作者: · 浏览: 0

一、整体代码

01.cpp

#include 
  
   
using namespace std;
class Furniture
{
public:
    Furniture(int weight) : weight_(weight)
    {
        cout<<"Furniture ..."<
   
    

二、结果如下:

Furniture ...
Bed ...
Sofa ...
SofaBed ...


FoldIn ...
Watch TV ...
FoldOut ...
Sleep ...


~SofaBed ...
~Sofa ...
~Bed ...
~Furniture ...