c语言int、float、long、char各有多少位

如题所述

第1个回答  2022-09-22

1、在32位系统中:

char(1)字节

short(2)字节

int(2)字节

long(4)字节

char*(4)字节

int*(4)字节

int**(4)字节

2、在64位系统中:

char(1)字节

short(2)字节

int(4)字节

long(8)字节

char*(4)字节

int*(4)字节

int**(4)字节

扩展资料

在C++中short占2字节,int、float、long都占4字节,double占8字节。

指针长度和地址总线有关。因为指针记录的就是一个地址,那么32位的就是4字节,64位的就是8字节。

char占1字节,short占2字节,int、float、long都占4字节,double占8字节,任意类型的指针都占4个字节。

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网