• <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 點點滴滴 閱讀(160) 評論(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久久久香蕉| 国产91久久精品一区二区| 久久精品中文字幕有码| 亚洲国产成人精品91久久久 | 久久青青国产| 色综合久久综合中文综合网| segui久久国产精品| 亚洲人AV永久一区二区三区久久| 婷婷五月深深久久精品| 99久久久久| 婷婷五月深深久久精品| 亚洲欧美精品一区久久中文字幕| 国产精品99久久精品| 亚洲日韩中文无码久久| 无码任你躁久久久久久| 久久国产综合精品五月天| .精品久久久麻豆国产精品| 久久经典免费视频| 久久精品国产亚洲7777| 91亚洲国产成人久久精品网址| 久久九九有精品国产23百花影院| 亚洲人成无码www久久久| 久久国产一片免费观看| 国产免费久久久久久无码| 狠狠色丁香婷婷久久综合不卡| 亚洲欧美日韩中文久久| 久久久久久国产a免费观看黄色大片 | 国色天香久久久久久久小说 | 少妇人妻88久久中文字幕| 久久国产精品免费| 久久精品成人欧美大片| 国内精品久久久久久久涩爱 | 一本色道久久88加勒比—综合| jizzjizz国产精品久久| 99久久国语露脸精品国产| 国产精品久久久久久久久免费| 国内精品人妻无码久久久影院| 丰满少妇人妻久久久久久 | 久久夜色精品国产亚洲| 久久午夜无码鲁丝片秋霞 | 久久人人爽人人爽人人片AV不|