首页 > 编程语言 > 详细

【ThinkingInC++】8、说明符,探讨数据类型的大小

时间:2014-08-10 13:05:00      阅读:283      评论:0      收藏:0      [点我收藏+]
/**
* 功能:说明符,探讨数据类型的大小
* 时间:2014年8月10日11:02:02
* 作者:cutter_point
*/

#include<iostream>

using namespace std;

int main()
{
    char c;
    unsigned char cu;
    short int is;
    short iis;
    unsigned short int isu;
    unsigned short iisu;
    int i;
    unsigned int iu;
    long int il;
    long iil;
    unsigned long int ilu;
    unsigned long iilu;
    float f;
    double d;
    long double ld;

    cout
        <<"\n char= "<<sizeof(c)
        <<"\n unsigned= "<<sizeof(cu)
        <<"\n short int= "<<sizeof(is)
        <<"\n short= "<<sizeof(iis)
        <<"\n unsigned short int= "<<sizeof(isu)
        <<"\n unsigned short= "<<sizeof(iisu)
        <<"\n int= "<<sizeof(i)
        <<"\n unsigned int= "<<sizeof(iu)
        <<"\n long int= "<<sizeof(il)
        <<"\n long= "<<sizeof(iil)
        <<"\n unsigned long int= "<<sizeof(ilu)
        <<"\n unsigned long= "<<sizeof(iilu)
        <<"\n float= "<<sizeof(f)
        <<"\n double= "<<sizeof(d)
        <<"\n long double= "<<sizeof(ld)
        <<endl;

    return 0;
}

【ThinkingInC++】8、说明符,探讨数据类型的大小,布布扣,bubuko.com

【ThinkingInC++】8、说明符,探讨数据类型的大小

原文:http://blog.csdn.net/cutter_point/article/details/38468265

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!