• <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>
            Impossible is nothing  
              愛過知情重醉過知酒濃   花開花謝終是空   緣份不停留像春風來又走   女人如花花似夢
            公告
            日歷
            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345
            統計
            • 隨筆 - 8
            • 文章 - 91
            • 評論 - 16
            • 引用 - 0

            導航

            常用鏈接

            留言簿(4)

            隨筆分類(4)

            隨筆檔案(8)

            文章分類(77)

            文章檔案(91)

            相冊

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

             

            1.使用max/min時可以給一個比較函數指針。
            #include <algorithm>
            using namespace std;

            /* function that compares two pointers by comparing the values to which they point
            ?*/
            bool int_ptr_less (int* a, int* b)
            {
            ??? return *a < *b;
            }

            int main()
            {
            ??? int x = 17;
            ??? int y = 42;
            ??? int* px = &x;
            ??? int* py = &y;
            ??? int* pmax;

            ??? // call max() with special comparison function
            ??? pmax = max (px, py, int_ptr_less);
            ??? //...
            }
            這是源代碼(MSVC7):
            template<class _Ty,
            ?class _Pr> inline
            ?const _Ty& _MAX(const _Ty& _Left, const _Ty& _Right, _Pr _Pred)
            ?{?// return larger of _Left and _Right using _Pred
            ?return (_Pred(_Left, _Right) ? _Right : _Left);
            ?}

            2.設置boolalpha可以讓流輸出bool值的字符串形式

            ?cout << boolalpha ;
            ?bool b = true;
            ?cout << b <<"*********"<<!b << endl;
            結果:
            true*********false
            3。一下代碼可以測試你的系統各類型的范圍
            #include <iostream>
            #include <limits>
            #include <string>
            using namespace std;

            int main()
            {
            ?? // use textual representation for bool
            ?? cout << boolalpha;

            ?? // print maximum of integral types
            ?? cout << "max(short): " << numeric_limits<short>::max() << endl;
            ?? cout << "max(int):?? " << numeric_limits<int>::max() << endl;
            ?? cout << "max(long):? " << numeric_limits<long>::max() << endl;
            ?? cout << endl;

            ?? // print maximum of floating-point types
            ?? cout << "max(float):?????? "
            ??????? << numeric_limits<float>::max() << endl;
            ?? cout << "max(double):????? "
            ??????? << numeric_limits<double>::max() << endl;
            ?? cout << "max(long double): "
            ??????? << numeric_limits<long double>::max() << endl;
            ?? cout << endl;

            ?? // print whether char is signed
            ?? cout << "is_signed(char): "
            ??????? << numeric_limits<char>::is_signed << endl;
            ?? cout << endl;

            ?? // print whether numeric limits for type string exist
            ?? cout << "is_specialized(string): "
            ??????? << numeric_limits<string>::is_specialized << endl;
            }

            posted on 2006-06-28 16:12 笑笑生 閱讀(665) 評論(1)  編輯 收藏 引用 所屬分類: STL/BOOST
            評論:
             
            Copyright © 笑笑生 Powered by: 博客園 模板提供:滬江博客
            少妇被又大又粗又爽毛片久久黑人| 久久99精品国产麻豆宅宅| 久久人妻少妇嫩草AV无码蜜桃| 国产激情久久久久影院老熟女| 久久国产成人午夜aⅴ影院 | 91久久精品91久久性色| 国产精品久久久久AV福利动漫| 国产成人久久久精品二区三区 | 久久午夜免费视频| 色欲综合久久躁天天躁蜜桃| 久久91亚洲人成电影网站| 精品人妻伦一二三区久久| 久久国产精品一国产精品金尊| 国产精品99久久不卡| 日日躁夜夜躁狠狠久久AV| 欧美一区二区精品久久| 久久久久高潮综合影院| 精品久久久久久无码人妻蜜桃| 久久精品亚洲中文字幕无码麻豆| 性做久久久久久久久| 久久久中文字幕| 亚洲国产精品无码成人片久久| 久久人人爽人人精品视频| 久久天堂电影网| 精品久久久久久综合日本| 久久久久99精品成人片欧美| 久久综合色老色| 久久亚洲AV无码西西人体| 久久婷婷五月综合色奶水99啪| 偷偷做久久久久网站| 精品久久久久一区二区三区| 99久久精品国产一区二区蜜芽| 亚洲人成网亚洲欧洲无码久久| 一级a性色生活片久久无少妇一级婬片免费放 | 亚洲国产婷婷香蕉久久久久久| 国产精品永久久久久久久久久| 青青草原综合久久| 国产精品热久久无码av| 国产亚洲欧美成人久久片| 好属妞这里只有精品久久| 精品久久久久久综合日本|