<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Greedy的工作室

    posts - 23,comments - 7,trackbacks - 0
    C++與Java基本數據類型及所占用內存空間比較
    ----------------C++------------------------Java----------
    (01)01)bool----------------1 byte-----01)boolean--1 byte
    (02)02)char----------------1 byte-----02)char-----2 bytes
    (03)---signed char---------1 byte     03)byte-----1 byte
    (04)---unsigned char-------1 byte
    (05)03)wchar_t-------------2 bytes
    (06)04)short---------------2 bytes----04)short----2 bytes
    (07)---unsigned short------2 bytes
    (08)05)int-----------------4 bytes----05)int------4 bytes
    (09)---unsigned int--------4 bytes
    (10)06)long----------------4 bytes----06)long-----8 bytes
    (11)---unsigned long-------4 bytes
    (12)07)long long-----------8 bytes
    (13)---unsigned long long--8 bytes
    (14)08)float---------------4 bytes----07)float----4 bytes
    (15)09)double--------------8 bytes----08)double---8 bytes
    (16)10)long double--------12 bytes
    ----------------------------------------------------------
     
    下面C++代碼在Code::Blocks 8.02 中測試通過。
     
    #include <iostream>
    #include <iomanip>
    using namespace std;
     
    #define W setw(20)
     
    int main(int argc,char** argv) {
        cout.setf(ios_base::right);
        cout<<W<<"bool:"<<sizeof(bool)<<endl;
        cout<<W<<"char:"<<sizeof(char)<<endl;
        cout<<W<<"signed char:"<<sizeof(signed char)<<endl;
        cout<<W<<"unsigned char:"<<sizeof(unsigned char)<<endl;
        cout<<W<<"wchar_t:"<<sizeof(wchar_t)<<endl;
        cout<<W<<"short:"<<sizeof(short)<<endl;
        cout<<W<<"unsigned short:"<<sizeof(unsigned short)<<endl;
        cout<<W<<"int:"<<sizeof(int)<<endl;
        cout<<W<<"unsigned int:"<<sizeof(unsigned int)<<endl;
        cout<<W<<"long:"<<sizeof(long)<<endl;
        cout<<W<<"unsigned long:"<<sizeof(unsigned long)<<endl;
        cout<<W<<"long long:"<<sizeof(long long)<<endl;
        cout<<W<<"unsigned long long:"<<sizeof(unsigned long long)<<endl;
        cout<<W<<"float:"<<sizeof(float)<<endl;
        cout<<W<<"double:"<<sizeof(double)<<endl;
        cout<<W<<"long double:"<<sizeof(long double)<<endl;
        return EXIT_SUCCESS;
    }
    //-----
                   bool:1
                   char:1
            signed char:1
          unsigned char:1
                wchar_t:2
                  short:2
         unsigned short:2
                    int:4
           unsigned int:4
                   long:4
          unsigned long:4
              long long:8
     unsigned long long:8
                  float:4
                 double:8
            long double:12
    //-----
    posted on 2008-11-19 11:47 greedy 閱讀(1497) 評論(0)  編輯  收藏 所屬分類: Java技術
    主站蜘蛛池模板: 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 亚洲精品无码AV中文字幕电影网站| avtt天堂网手机版亚洲| 亚洲免费福利视频| 亚洲男人电影天堂| 免费A级毛片无码专区| 内射少妇36P亚洲区| 3d成人免费动漫在线观看| 91天堂素人精品系列全集亚洲| 午夜视频在线免费观看| 精品日韩亚洲AV无码| 成人免费观看一区二区| 亚洲人成在线精品| 成年女人男人免费视频播放 | 亚洲精品国产成人专区| 97在线视频免费播放| 亚洲国产成人精品久久| 女人张腿给男人桶视频免费版| 亚洲AV色欲色欲WWW| 2022中文字字幕久亚洲| 国产精品免费一区二区三区四区| 亚洲综合精品一二三区在线| 国产成人精品免费视频大| 亚洲熟妇自偷自拍另欧美| 少妇亚洲免费精品| 久久99久久成人免费播放| 久久亚洲国产精品| 成年人网站在线免费观看| 国产精品亚洲专区在线播放| 国产国拍精品亚洲AV片| 91大神在线免费观看| 亚洲精品无码久久久久久| 亚洲综合精品网站| 最近最新高清免费中文字幕| 亚洲老熟女五十路老熟女bbw| 亚洲男人的天堂在线va拉文| 2021国内精品久久久久精免费| 久久久久久亚洲精品无码| 亚洲中文字幕无码一久久区| 天天影院成人免费观看| jizz中国免费|