c语言int占几个字节?

日期:2020-12-23 15:15:07 人气:1

c语言int占几个字节?

在一般的电脑中,int占用4字节,32比特,数据范围为-2147483648~2147483647[-2^31~2^31-1] 在之前的微型机中,int占用2字节,16比特,数据范围为-32768~32767[-2^15~2^15-1] 使用printf输出int占用字节数量: printf("%d",sizeof(int)); 除了int类型之外,还有short、long、long long类型可以表示整数。 unsigned int 表示无符号整数,数据范围为[0~2^32-1]
    A+
热门评论