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 |