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

            国产成人久久久精品二区三区| 国产成人AV综合久久| 久久露脸国产精品| 99久久这里只精品国产免费| 一本一道久久a久久精品综合 | 欧美午夜A∨大片久久| 久久国产福利免费| 久久久久久免费视频| 久久久久无码精品国产不卡| 91精品国产高清久久久久久io| 91精品国产9l久久久久| 久久午夜综合久久| 欧美午夜精品久久久久免费视| 精品国产91久久久久久久| 久久久黄片| 国产成人精品白浆久久69| 要久久爱在线免费观看| 精品国际久久久久999波多野| 国产成人久久精品二区三区| 亚洲中文字幕无码久久2017| 久久se精品一区精品二区| 伊人久久一区二区三区无码| 99久久精品午夜一区二区| 久久夜色精品国产噜噜亚洲a| 国产精品美女久久久久久2018| 综合久久久久久中文字幕亚洲国产国产综合一区首 | 999久久久免费国产精品播放| 伊人伊成久久人综合网777| 国产精品久久自在自线观看| 18禁黄久久久AAA片| 精品久久人人做人人爽综合| 久久久精品国产sm调教网站| 天天影视色香欲综合久久| 亚洲伊人久久大香线蕉苏妲己| 一本久道久久综合狠狠爱| 欧美精品福利视频一区二区三区久久久精品| 亚洲AV无码一区东京热久久| 亚洲伊人久久成综合人影院 | 精品人妻伦九区久久AAA片69| 国内精品久久久久久野外| 久久夜色精品国产网站|