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

            99久久中文字幕| 国产精品99久久99久久久| 国产99久久精品一区二区| 狠狠色丁香久久综合五月| 久久国产一区二区| 久久亚洲sm情趣捆绑调教| 婷婷伊人久久大香线蕉AV | 精品久久久久久国产潘金莲| 久久美女人爽女人爽| 国内精品久久久久久久久电影网| 久久香蕉国产线看观看精品yw| 国产精品免费久久久久影院| 亚洲成色WWW久久网站| 伊人久久一区二区三区无码| 94久久国产乱子伦精品免费| 国产V亚洲V天堂无码久久久| 伊人久久大香线蕉亚洲| 婷婷久久综合九色综合绿巨人| 精品久久久久久无码中文野结衣| 最新久久免费视频| 久久久久九九精品影院| 色综合久久中文字幕综合网| 国产精品久久国产精麻豆99网站| 东京热TOKYO综合久久精品| 色综合久久久久久久久五月| 亚洲va久久久久| 成人资源影音先锋久久资源网| 人妻精品久久无码区| 国产A级毛片久久久精品毛片| 国产精品无码久久综合网| 噜噜噜色噜噜噜久久| 国产A三级久久精品| 国产精品欧美久久久久无广告| 久久精品无码一区二区app| 久久不见久久见免费视频7| 久久久久久久久久久免费精品| 久久综合九色综合网站| 久久久久99精品成人片| 国产精品99精品久久免费| 中文字幕久久精品| 久久中文字幕无码专区|