• <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++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            (地基工)virtual 關鍵字

            Posted on 2011-02-28 16:28 點點滴滴 閱讀(208) 評論(0)  編輯 收藏 引用 所屬分類: 02 編程語言
            class test1
            {
            public:
                
            virtual void animation()
                {
                    cout 
            << "test1 animation" << endl;
                }

                
            virtual void animation1() = 0;
            };

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

            class test3 :public test2
            {
                
            void animation1()
                {
                    cout 
            << "test3 animation1" << endl;
                }
                
            void animation()
                {
                    cout 
            << "test3 animation" << endl;
                }
            };

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

            //     //定義
            //     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;
            }
            virtual 為重載關鍵字,父類方法加上這個關鍵字,可以實現重載
            輸出:
            test3 animation
            test3 animation1
            伊人久久综合成人网| 国产精品欧美久久久久天天影视 | 久久精品国产91久久麻豆自制 | 久久久久国产亚洲AV麻豆| 久久久久亚洲精品天堂久久久久久 | 精品综合久久久久久97| 亚洲国产精品一区二区久久hs | 韩国三级中文字幕hd久久精品 | 久久午夜福利无码1000合集| 亚洲va中文字幕无码久久| 日本久久久精品中文字幕| 亚洲精品久久久www| 亚洲成色999久久网站| 亚洲日韩中文无码久久| 国产成人综合久久精品尤物| 亚洲午夜无码久久久久| 亚洲国产成人精品无码久久久久久综合 | 亚洲?V乱码久久精品蜜桃| 狠狠色丁香婷婷综合久久来| 久久青青草视频| 久久精品国产一区二区三区不卡 | 99久久免费国产特黄| 久久夜色精品国产噜噜亚洲a| 精品国产91久久久久久久| 久久无码专区国产精品发布| 久久久久亚洲AV综合波多野结衣| 久久亚洲精品人成综合网| 2021最新久久久视精品爱| 久久国产成人午夜AV影院| 久久97精品久久久久久久不卡 | 久久亚洲国产精品五月天婷| 国产精品久久波多野结衣| 久久综合给合久久狠狠狠97色| 一级做a爰片久久毛片看看| 久久电影网| 少妇被又大又粗又爽毛片久久黑人 | 久久精品国产网红主播| 久久青青草原亚洲av无码app| 7777久久久国产精品消防器材| 欧美日韩精品久久免费| 国内精品伊人久久久久777|