变量类型的字节大小

通用标准规定了long不小于int的长度,int不小于short的长度,float按照IEEE的标准是32位,double是64位,char是8位(1字节),其他的类型都不一定,由编译器决定:

字节数 short unsigned int/int unsigned long/long float double char long long 指针
16位 2 2 4 4 8 1 8 2
32位 2 4 4 4 8 1 8 4
64位 2 4 8 4 8 1 8 8
发布了37 篇原创文章 · 获赞 33 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/xu_fengyu/article/details/86669441