• <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久久精品国产免看国产一区| 久久国产精品久久久| 欧美久久一区二区三区| 无码人妻久久一区二区三区免费丨 | 久久久久久无码Av成人影院| 91秦先生久久久久久久| 久久久久久久精品成人热色戒| 91精品国产综合久久香蕉 | 青青草国产精品久久久久| 久久精品无码av| 欧美一区二区精品久久| 亚洲色欲久久久综合网东京热| 51久久夜色精品国产| 色88久久久久高潮综合影院| 久久久久国产一区二区| 青青草国产成人久久91网| 无码AV波多野结衣久久| 久久精品视频一| 久久国产成人午夜aⅴ影院| 好属妞这里只有精品久久| 中文无码久久精品| 久久伊人精品一区二区三区| 久久久久亚洲AV综合波多野结衣| 久久99精品综合国产首页| 久久久久人妻精品一区| 欧美熟妇另类久久久久久不卡| 女同久久| 国内精品人妻无码久久久影院导航 | 国内精品久久国产| 日日狠狠久久偷偷色综合96蜜桃| 精品久久久久久久久久久久久久久 | 77777亚洲午夜久久多喷| 欧美黑人又粗又大久久久| 日本久久久久亚洲中字幕| 久久综合综合久久综合| 好久久免费视频高清| 国产毛片久久久久久国产毛片 | 99精品久久精品一区二区|