• <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 閱讀(545) 評論(0)  編輯 收藏 引用 所屬分類: c++實例
            青青青青久久精品国产h久久精品五福影院1421 | 久久免费视频一区| 久久久精品久久久久特色影视| 亚洲日韩欧美一区久久久久我| 99久久免费国产精品特黄| 久久精品天天中文字幕人妻| 久久久中文字幕| 久久久久久人妻无码| 国产精品免费久久久久影院 | 91精品免费久久久久久久久| 亚洲欧美一级久久精品| 色综合久久久久无码专区 | 一本久道久久综合狠狠爱| 久久精品这里热有精品| 久久精品国产免费观看三人同眠| 亚洲国产精品久久久久久| 日韩久久久久久中文人妻| 色婷婷久久综合中文久久一本| 久久成人影院精品777| 午夜欧美精品久久久久久久| 人妻中文久久久久| 国产精品九九久久免费视频 | 亚洲中文字幕久久精品无码喷水| 亚洲天堂久久精品| 久久精品国产亚洲av麻豆蜜芽 | 久久久久亚洲AV无码观看| 久久精品国产亚洲网站| 狠狠色婷婷久久综合频道日韩| 久久亚洲欧美日本精品| 999久久久无码国产精品| 久久午夜无码鲁丝片秋霞| 久久综合日本熟妇| 久久99国产精品成人欧美| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 久久精品免费观看| 久久99精品久久久久久久久久| 久久久久97国产精华液好用吗| 国产成人AV综合久久| 四虎国产精品免费久久5151| 久久噜噜电影你懂的| 精品水蜜桃久久久久久久|