• <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++實例
            99久久99久久精品国产片| 国产精品99久久免费观看| 久久天天躁狠狠躁夜夜2020老熟妇| 精品亚洲综合久久中文字幕| 国产精品亚洲美女久久久| 亚洲AⅤ优女AV综合久久久| 久久久久高潮毛片免费全部播放 | 久久天天躁狠狠躁夜夜不卡| 亚洲午夜无码久久久久| 精品久久久无码中文字幕| 尹人香蕉久久99天天拍| 久久久久久综合一区中文字幕| 久久精品国产精品亚洲艾草网美妙| 性色欲网站人妻丰满中文久久不卡| 久久精品成人免费网站| 午夜精品久久久久久久久| 国产成人精品综合久久久| 亚洲香蕉网久久综合影视| 久久天天躁狠狠躁夜夜不卡| 欧洲人妻丰满av无码久久不卡 | 国内精品久久国产| 91精品无码久久久久久五月天| 中文字幕乱码人妻无码久久| 国产精品无码久久综合网| 青青草原1769久久免费播放| 久久久老熟女一区二区三区| 久久中文字幕人妻熟av女| 亚洲午夜精品久久久久久app| 天天爽天天爽天天片a久久网| 国产亚洲色婷婷久久99精品| 亚洲综合伊人久久综合| 欧美精品九九99久久在观看| 欧美激情精品久久久久久久| 久久丝袜精品中文字幕| 久久精品这里只有精99品| 国产一区二区精品久久岳| 国产99久久久国产精免费| 国产亚州精品女人久久久久久| 91精品国产综合久久四虎久久无码一级 | 久久夜色精品国产欧美乱| 人妻精品久久久久中文字幕69|