<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      單一繼承多次與多重繼承的構造與析構

      單一繼承多次

      代碼:

      class great_great_father
      {
      public:
          great_great_father()
          {
              cout << "function: \tgreat_great_father()" << std::endl;
          }
          ~great_great_father()
          {
              cout << "function: \t~great_great_father()" << std::endl;
          }
      };
      
      class great_father : public great_great_father
      {
      public:
          great_father()
          {
              cout << "function: \tgreat_father()" << std::endl;
          }
          ~great_father()
          {
              cout << "function: \t~great_father()" << std::endl;
          }
      };
      
      class father : public great_father
      {
      public:
          father()
          {
              cout << "function: \tfather()" << std::endl;
          }
          ~father()
          {
              cout << "function: \t~father()" << std::endl;
          }
      };
      
      class son : public father
      {
      public:
          son()
          {
              cout << "function: \tson()" << std::endl;
          }
          ~son()
          {
              cout << "function: \t~son()" << std::endl;
          }
      };
      int main(int argc, char *argv[])
      {
          {
              son s;
          }
      
          system("pause");
          return 0;
      }

      son s;語句放在代碼塊里,使得析構放在主函數結束前。

      類圖如下

      運行結果:

       

      多重繼承

      代碼:

      class father1
      {
      public:
          father1()
          {
              cout << "function: \tfather1()" << std::endl;
          }
          ~father1()
          {
              cout << "function: \t~father1()" << std::endl;
          }
      };
      
      class father2
      {
      public:
          father2()
          {
              cout << "function: \tfather2()" << std::endl;
          }
          ~father2()
          {
              cout << "function: \t~father2()" << std::endl;
          }
      };
      
      class father3
      {
      public:
          father3()
          {
              cout << "function: \tfather3()" << std::endl;
          }
          ~father3()
          {
              cout << "function: \t~father3()" << std::endl;
          }
      };
      
      class son : public father1, public father2, public father3
      {
      public:
          son()
          {
              cout << "function: \tson()" << std::endl;
          }
          ~son()
          {
              cout << "function: \t~son()" << std::endl;
          }
      };
      int main(int argc, char *argv[])
      {
          {
              son s;
          }
      
          system("pause");
          return 0;
      }

      類圖:

      運行結果:

      編譯器:Visual Studio 2015 -> cl.exe

      實踐很有意思!

      posted @ 2016-03-04 22:29  literalkernel  閱讀(756)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 日韩少妇人妻vs中文字幕| 精品黑人一区二区三区| a级国产乱理伦片在线观看al | 黑人巨大亚洲一区二区久| 巨熟乳波霸若妻在线播放| 性一交一乱一乱一视频| 中文乱码人妻系列一区二区| 亚洲国产精品视频一二区| 久久久国产一区二区三区四区小说 | 99久久精品国产一区二区蜜芽| 成全高清在线播放电视剧| 国产亚洲精品久久久久婷婷图片| 午夜精品极品粉嫩国产尤物| 亚洲精品乱码久久久久红杏| 久久妇女高潮喷水多| 国产免费无遮挡吃奶视频| 伊在人间香蕉最新视频| 日韩av一区二区精品不卡| 中文字幕av无码不卡| 国产精品久久人妻无码网站一区| 亚洲成在人天堂一区二区| 国产360激情盗摄全集| 久久国产精品日本波多野结衣| 国产精品妇女一区二区三区| 99久久国产成人免费网站| 广饶县| caoporn免费视频公开| 99在线精品免费视频| 国产熟睡乱子伦视频在线播放| 一区二区在线观看 激情| 女人色熟女乱| 性视频一区| 国产精品白嫩极品在线看| 国产精品一区二区无线| 亚洲av综合久久成人网| 午夜福利看片在线观看| 久久99国产乱子伦精品免费| 丰满熟妇人妻中文字幕| 亚洲男人AV天堂午夜在| 平顺县| 国产蜜臀久久av一区二区|