• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 311, comments - 0, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            (地基工)VC析構函數

            Posted on 2011-03-02 10:31 點點滴滴 閱讀(154) 評論(0)  編輯 收藏 引用 所屬分類: 02 編程語言
            析構函數使用virtual關鍵字,子類會先調用自己的析構函數然后自動調用父類的析構函數,否則直接調用當前的承接類的析構函數。



            class test1
            {
            public:
                
            virtual void animation()
                {
                    cout 
            << "test1 animation" << endl;
                }

                
            virtual void animation1() = 0;

                
            virtual ~test1()
                {
                    cout 
            << "test1 destroy animation" << endl;
                }
            };
            class test2 : public test1
            {
            public:
                
            virtual void animation1()
                {
                    cout 
            << "test2 animation1" << endl;
                }
                
            void animation()
                {
                    cout 
            << "test2 animation" << endl;
                }

                 
            ~test2()
                {
                    cout 
            << "test2 destroy animation" << endl;
                }
            };

            int _tmain(int argc, _TCHAR* argv[])
            {
            //    allocatePractice();
                test1* test = new test2();
                test
            ->animation();
                test
            ->animation1();
                delete test;

            //     //定義
            //     std::pair<int, string> ming(1,"ming1");
            //     std::map<int ,string> authors;
            //     //插入
            //     authors.insert(make_pair(3,"ming3"));
            //     authors.insert(map<int, string>::value_type(2,"ming2"));
            //     authors.insert(ming);    
            // 
            //     cout << authors[4] << endl;
                

                
            return 0;
            }
            久久精品人人做人人爽电影蜜月| 久久99精品国产99久久6| 久久影院综合精品| 久久国产亚洲高清观看| 久久国产精品免费| 一本色道久久HEZYO无码| 一本久久久久久久| 99久久国产精品免费一区二区| a高清免费毛片久久| 蜜桃麻豆www久久国产精品| 久久精品国产亚洲精品2020| 国产精品美女久久久久AV福利| 亚洲AV无码久久| 色综合久久天天综线观看| 日本精品久久久久中文字幕8| 国产成人精品综合久久久久 | 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久久精品波多野结衣| 91精品国产综合久久久久久| 久久香综合精品久久伊人| 国产精品嫩草影院久久| 国产精品美女久久久久久2018| 亚洲精品NV久久久久久久久久 | 99麻豆久久久国产精品免费| 久久久久亚洲av成人网人人软件| 精品多毛少妇人妻AV免费久久| 97久久精品人妻人人搡人人玩| 伊人久久精品无码二区麻豆| 欧美午夜A∨大片久久 | AV无码久久久久不卡网站下载| 无码国产69精品久久久久网站| 久久精品视频一| 欧美日韩久久中文字幕| 久久久久久久精品妇女99| 无码任你躁久久久久久老妇App| 久久久久久A亚洲欧洲AV冫| 久久国产成人亚洲精品影院| 国内精品伊人久久久久网站| 久久se这里只有精品| 午夜精品久久久久久影视777| 欧美无乱码久久久免费午夜一区二区三区中文字幕 |