int 和 long 在windows和linux 下所占字节数如下图所示
win32 | win64 | linux32 | linux64 | |
int | 4 | 4 | 4 | 4 |
long | 4 | 4 | 4 | 8 |
推荐使用std一套有关整形的申明, 详细请参阅stdint.h
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;