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

            luqingfei@C++

            為中華之崛起而崛起!
            兼聽則明,偏聽則暗。

            關于函數重載的練習

             

            #include <iostream>
            #include 
            <string>
            using std::cout;
            using std::endl;
            using std::string;

            // Function prototype
            int plus(int a, int b);
            double plus(double a, double b);
            string plus(const string& a, const string& b);

            void main() {
                cout 
            << "plus(3, 4) = " << plus(34<< endl;
                cout 
            << "plus(3.2, 4.2) = " << plus(3.24.2<< endl;
                cout 
            << "plus(\"he\", \"llo\") = " << plus("he""llo"<< endl;
                
                cout 
            << "plus(static_cast<double>(3), 4.2) = " << plus(static_cast<double>(3), 4.2<< endl;
                cout 
            << "plus(3, static_cast<int>(4.2)) = " << plus(3, static_cast<int>(4.2)) << endl;

            }


            int plus(int a, int b) {
                
            return a + b;
            }


            double plus(double a, double b) {
                
            return a + b;
            }


            string plus(const string& a, const string& b) {
                
            return a + b;
            }

            posted on 2009-02-13 17:34 luqingfei 閱讀(252) 評論(0)  編輯 收藏 引用 所屬分類: C++基礎

            導航

            <2009年2月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            1234567

            統計

            留言簿(6)

            隨筆分類(109)

            隨筆檔案(105)

            Blogers

            Game

            Life

            NodeJs

            Python

            Useful Webs

            大牛

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            評論排行榜

            精品久久久久久无码中文野结衣 | 久久国产精品偷99| 久久97久久97精品免视看| 中文字幕无码久久人妻| 人妻丰满AV无码久久不卡| 久久综合丁香激情久久| 伊人久久大香线蕉无码麻豆| 国产精品久久久久久福利漫画| 欧美亚洲另类久久综合婷婷 | 久久精品国产一区| 亚洲?V乱码久久精品蜜桃| 久久99国产精品久久久 | 91久久九九无码成人网站| 久久无码中文字幕东京热| 久久国产精品久久久| 欧美喷潮久久久XXXXx| 久久人人青草97香蕉| 伊人色综合久久| 99久久人妻无码精品系列| 波多野结衣AV无码久久一区| 久久露脸国产精品| 久久国产成人| 久久久久国产一区二区三区| 天天综合久久久网| 老司机国内精品久久久久| 国产精品久久久久久一区二区三区| 久久人妻无码中文字幕| 久久99这里只有精品国产| 亚洲精品视频久久久| 久久亚洲AV无码西西人体| 青青草原综合久久大伊人导航| 国产精品美女久久久免费| 国产精品99久久久久久董美香| 91性高湖久久久久| 精品久久久久久久久久中文字幕| 99久久精品免费| 久久久久亚洲精品天堂久久久久久 | 中文字幕精品无码久久久久久3D日动漫 | 久久99国内精品自在现线| 国产∨亚洲V天堂无码久久久| 国产精品美女久久久久网|