• <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>

            c++實例研究

            從0開始

              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              104 隨筆 :: 0 文章 :: 20 評論 :: 0 Trackbacks
            #include <iostream>
            #include 
            <cstdlib>
            using namespace std;

            class Foo
            {
            public:
                Foo(
            int ii):i(ii){}
                
            int getInt(){return i;}
            private:
                
            int i;
            }
            ;

            class Bar
            {
            public:
                
            static int FooVal(){c++return f.getInt();}
                
            int callsFooVal(){return c;}
                
            int setValb(int bb=c){b=bb;return 0;} //可變的默認值 
                int show(){return b;}
            private:
                
            int b;
                
            static int c;
                
            static Foo f;
            }
            ;

            int Bar::c=0;
            Foo Bar::f(
            9);

            int main()
            {
                Bar b;
                cout
            <<Bar::FooVal()<<endl; 
                cout
            <<b.callsFooVal()<<endl;   
                cout
            <<b.setValb()<<endl;
                cout
            <<b.show()<<endl;
                cout
            <<"---------"<<endl;
                cout
            <<Bar::FooVal()<<endl; 
                cout
            <<b.callsFooVal()<<endl;
                cout
            <<b.setValb()<<endl;
                cout
            <<b.show()<<endl;  
                cout
            <<"---------"<<endl;
                cout
            <<Bar::FooVal()<<endl; 
                cout
            <<b.callsFooVal()<<endl; 
                cout
            <<b.setValb()<<endl;
                cout
            <<b.show()<<endl;
                cout
            <<"---------"<<endl;
                system(
            "PAUSE");
                
            return 0;
            }

            posted on 2010-04-26 20:48 elprup 閱讀(539) 評論(0)  編輯 收藏 引用 所屬分類: c++實例
            久久99国产精品尤物| 久久青草国产手机看片福利盒子| 久久精品综合一区二区三区| 国内精品久久久久影院亚洲| 亚洲精品高清国产一线久久| 国产成人99久久亚洲综合精品| 久久亚洲高清综合| 精品熟女少妇av免费久久| 国产精品美女久久久久AV福利 | 99久久无码一区人妻| 亚洲国产成人久久笫一页| 国产亚洲精久久久久久无码| 久久精品国产一区二区| 996久久国产精品线观看| 国产精品久久久久久久人人看| 91精品国产高清久久久久久91| 久久精品国产亚洲AV香蕉| 精品久久久久国产免费| 99久久99这里只有免费的精品| 欧美久久久久久| 久久99热这里只有精品国产| 久久久久亚洲AV无码网站| 久久婷婷五月综合成人D啪| 国産精品久久久久久久| 99久久精品国产一区二区| 久久精品这里热有精品| 久久人人爽人人爽人人片AV不| 久久婷婷人人澡人人爽人人爱| 久久久无码精品午夜| 精品久久久无码中文字幕 | 日本久久久久久久久久| 色综合久久中文综合网| 国产精品美女久久久久网| 91精品国产高清久久久久久io| 久久久久久午夜成人影院| 久久亚洲AV成人出白浆无码国产| 一本色综合网久久| 人妻少妇久久中文字幕一区二区| 亚洲精品tv久久久久久久久| 久久久av波多野一区二区| 99麻豆久久久国产精品免费|