• <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 點點滴滴 閱讀(211) 評論(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
            久久国产成人精品麻豆| 久久亚洲天堂| 久久国产乱子伦精品免费强| 97精品国产91久久久久久| 亚洲国产精品人久久| 噜噜噜色噜噜噜久久| 午夜人妻久久久久久久久| 久久精品免费观看| 久久久久国产| 久久久久久国产精品无码超碰| 久久被窝电影亚洲爽爽爽| 一97日本道伊人久久综合影院| 久久偷看各类wc女厕嘘嘘| 久久国产影院| 久久精品九九亚洲精品天堂| 合区精品久久久中文字幕一区| 久久精品亚洲一区二区三区浴池 | 久久国产成人精品麻豆| 久久有码中文字幕| 久久久老熟女一区二区三区| 色老头网站久久网| 国产精品99久久久久久宅男 | 国产情侣久久久久aⅴ免费| 国产精品久久久久久久久久免费| 一本久久知道综合久久| 久久九九免费高清视频 | 无码人妻久久一区二区三区蜜桃| 狠狠88综合久久久久综合网| 国内精品久久久久影院亚洲| 久久精品国产第一区二区| 久久亚洲精品中文字幕三区| 久久综合狠狠综合久久| 久久99久久99精品免视看动漫| 久久人人爽人人爽人人片AV麻豆| 老司机国内精品久久久久| 久久精品国产网红主播| 欧洲人妻丰满av无码久久不卡| 久久热这里只有精品在线观看| 亚洲国产精品无码久久久久久曰| 久久精品二区| 亚洲午夜精品久久久久久浪潮|