• <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 閱讀(536) 評論(0)  編輯 收藏 引用 所屬分類: c++實例
            久久久精品免费国产四虎| 天天久久狠狠色综合| 国产成人AV综合久久| 精品久久久久久中文字幕人妻最新 | 91精品国产9l久久久久| 国产亚洲婷婷香蕉久久精品| 无码人妻少妇久久中文字幕蜜桃| 婷婷久久五月天| 日韩影院久久| 亚洲国产另类久久久精品| 久久久久久精品免费看SSS| 久久精品国产2020| 久久久久亚洲av无码专区喷水 | AV无码久久久久不卡蜜桃| 欧美精品丝袜久久久中文字幕| 久久久WWW成人免费精品| 久久久久无码国产精品不卡| 综合久久给合久久狠狠狠97色| 亚洲伊人久久成综合人影院| 波多野结衣AV无码久久一区| 九九久久99综合一区二区| 成人午夜精品久久久久久久小说 | 久久久久99精品成人片| 久久青青草原精品国产软件| 亚洲精品午夜国产va久久| 亚洲精品乱码久久久久久蜜桃不卡| 无码人妻少妇久久中文字幕蜜桃| 久久国产精品成人免费| 国产精品欧美亚洲韩国日本久久 | 久久久精品一区二区三区| 亚洲а∨天堂久久精品| 久久婷婷五月综合97色| 久久久久亚洲AV无码专区网站| 久久亚洲精品无码VA大香大香| 精品国产VA久久久久久久冰| 国产真实乱对白精彩久久| 久久精品国产亚洲AV蜜臀色欲| 99精品国产在热久久无毒不卡| 99久久综合国产精品免费| 97久久超碰成人精品网站| 久久亚洲AV无码精品色午夜麻豆|