• <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 閱讀(176) 評論(0)  編輯 收藏 引用 所屬分類: Notes

            久久中文字幕人妻丝袜| 国内精品久久人妻互换| 久久亚洲国产精品五月天婷| 久久99精品久久久久久齐齐| 大蕉久久伊人中文字幕| 国产综合成人久久大片91| 欧美日韩久久中文字幕| 久久发布国产伦子伦精品 | 久久久国产精品| 亚洲国产另类久久久精品小说| 久久se精品一区二区| 久久精品国产亚洲av麻豆图片| 97精品国产97久久久久久免费| 无码8090精品久久一区| 久久久91精品国产一区二区三区| 中文字幕久久精品| 天天久久狠狠色综合| 一本久久a久久精品vr综合| 久久久91人妻无码精品蜜桃HD| 人妻少妇久久中文字幕一区二区| 久久精品三级视频| 伊人热人久久中文字幕| 精品国际久久久久999波多野| 久久人妻少妇嫩草AV蜜桃| 久久电影网一区| 69SEX久久精品国产麻豆| 亚洲精品蜜桃久久久久久| 欧美亚洲色综久久精品国产| 欧美精品乱码99久久蜜桃| 亚洲国产成人久久综合区| 久久综合给合综合久久| 国产L精品国产亚洲区久久| 久久精品国产精品亚洲精品| 久久国产精品99国产精| 9久久9久久精品| 91精品国产91久久久久久| 91精品无码久久久久久五月天| 久久福利青草精品资源站免费 | 2020最新久久久视精品爱| 狠狠久久亚洲欧美专区| 久久91综合国产91久久精品 |