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

            EverSpring working shop

            To pursue creative ideas based on nature.

            統計

            留言簿(1)

            他山之石

            閱讀排行榜

            評論排行榜

            Reading Notes - C++ Primer, 4th Edition

            class Sales_item {
            public:
                // operations on Sales_item objects
                double avg_price() const;
                bool same_isbn(const Sales_item &rhs) const
                    { return isbn == rhs.isbn; }
                // default constructor needed to initialize members of built-in type
                Sales_item(): units_sold(0), revenue(0.0) { }
            private:
                std::string isbn;
                unsigned units_sold;
                double revenue;
            };

            double Sales_item::avg_price() const
            {
                if (units_sold)
                    return revenue/units_sold;
                else
                    return 0;
            }
            • Const keyword used in the member function declarartion of a class definition:
              • const member may not change the data member of the objects on which it operates.
              • const should appear in both the declaration and the definition, otherwise the compliler will report the error.
            • Accesss Labels:
              • Member defined after a public label are accessible to all parts of the program. The data-abstraction view of a type is defined by its public members.
              • Member defined after a private label are not accessible to code that uses the class. The private sections encapsulate (e.g., hide) the implementation from code that uses the type.
              • For those members without the explicit access label:
                • Struct: default as public.
                • Class: default as private.
            • Internal state of the class is often designed as private. Only a member function could be responsible for the state transition error. It greatly eases the problems of maintenance and the program correctness.

            posted on 2007-10-07 16:27 everspring79 閱讀(171) 評論(0)  編輯 收藏 引用 所屬分類: Notes

            久久成人精品| 久久久久亚洲精品无码网址| 国内精品久久久久久久97牛牛| 97久久国产综合精品女不卡| 亚洲va久久久噜噜噜久久| 狠狠色婷婷久久一区二区三区| 久久精品这里只有精99品| 亚洲欧美日韩中文久久| 久久国产精品一区| 青青草原综合久久大伊人精品| 国产精品久久久久久久久久影院 | 7国产欧美日韩综合天堂中文久久久久| 一级做a爰片久久毛片人呢| 国产成人久久精品一区二区三区| 欧美久久久久久午夜精品| 久久久精品久久久久特色影视| 国产99久久久久久免费看| 久久av免费天堂小草播放| 久久人人爽人人爽AV片| 久久频这里精品99香蕉久| 久久伊人色| 97精品久久天干天天天按摩| 99久久伊人精品综合观看| 97香蕉久久夜色精品国产| 少妇高潮惨叫久久久久久| 久久亚洲精品中文字幕三区| 国产成人无码精品久久久免费| 久久精品无码一区二区日韩AV | 99久久亚洲综合精品网站| 999久久久国产精品| 亚洲精品美女久久久久99| 好属妞这里只有精品久久| 亚洲精品乱码久久久久66| 久久久精品视频免费观看| 久久婷婷午色综合夜啪| 久久伊人精品青青草原高清| 乱亲女H秽乱长久久久| 一本色道久久综合狠狠躁| 久久夜色精品国产亚洲| 99精品国产免费久久久久久下载| 久久人人爽人人爽人人片AV东京热|