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

            国内精品久久久久影院优| 伊人久久大香线焦AV综合影院| 国产精品久久久久AV福利动漫| A狠狠久久蜜臀婷色中文网| 久久精品视频网| 久久国产成人午夜aⅴ影院 | 精品国产乱码久久久久久1区2区| 久久精品国产精品亚洲精品| 久久久无码精品亚洲日韩软件| 日产精品久久久一区二区| 亚洲伊人久久大香线蕉苏妲己| 久久婷婷国产剧情内射白浆| 久久久久99精品成人片欧美| 久久久久久久久久免免费精品| 中文字幕热久久久久久久| 欧美777精品久久久久网| 久久精品免费一区二区| 国产99久久久国产精品~~牛| 一本色道久久综合亚洲精品| 中文字幕亚洲综合久久2| 久久久噜噜噜久久中文福利| 一本久久a久久精品综合香蕉| 国产精品久久久久久福利漫画 | 久久人人爽人人爽人人片AV高清| 91久久福利国产成人精品| 精品久久久久久成人AV| 久久九九兔免费精品6| 色综合合久久天天给综看| 欧美一区二区精品久久| www.久久热.com| 久久精品国产亚洲AV麻豆网站 | 99国产精品久久| 九九久久自然熟的香蕉图片| 欧美喷潮久久久XXXXx| 久久成人国产精品免费软件| 中文字幕久久亚洲一区| 一本色道久久综合狠狠躁篇| 久久青青草视频| 国产欧美久久久精品影院| 狠狠色噜噜色狠狠狠综合久久| 日韩精品无码久久一区二区三|