Windows下数据类型的字节数

Windows 32-bit, MSVC2010 SP1 32-bit

C:\arisnova\zsync\blah\typesize\msvc-build\Debug>sizes.exe
char size:  8 bits  (MAX VALUE: signed char  = 255, unsigned char = 511)(1个字节)
short size: 16 bits  (MAX VALUE: signed short  = 32767, unsigned short = 65535)(2个字节)
int size: 32 bits  (MAX VALUE: signed int  = 536870911, unsigned int = 1073741823)(4个字节)

size_t size: 32 bits  (MAX VALUE: size_t  = 536870911(4个字节)
long size: 32 bits  (MAX VALUE: signed long  = 536870911, unsigned long = 1073741823)(4个字节)
long long size: 64 bits  (MAX VALUE: signed long long  = 144115188075855871, unsigned long long = 1073741823)(8个字节)
void* size: 32 bits(4个字节)
off_t size: 32 bits(4个字节)
float size: 32 bits(4个字节)
double size: 64 bits(8个字节)


注意要看系统的位数!!!

https://www.assembla.com/spaces/zsync-windows/wiki/Types_sizes

Numerical type sizes in C (bits)

Platforms  \   Types char short int size_t ssize_t long long long void* off_t float double
Win32, gcc nuwen 7.2 8 16 32 32 32 32 64 32 32 32 64
Win32, gcc nuwen 7.2 LFF 8 16 32 32 32 32 64 32 32 32 64
Win32, MSVC 8 16 32 32 - 32 64 32 32 32 64
Linux32, gcc 8 16 32 32 32 32 64 32 32 32 64
Linux32, gcc LFF 8 16 32 32 32 32 64 32 64 32 64
Win64, gcc mingw64 8 16 32 64 64 32 64 64 32 32 64
Win64, gcc mingw64 LFF 8 16 32 64 64 32 64 64 64 32 64
Win64, MSVC 8 16 32 64 - 32 64 64 32 32 64
Linux64, gcc 8 16 32 64 64 64 64 64 64 32 64

Linux64, gcc LFF

8 16 32 64 64 64 64 64 64 32 64
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值