C语言数据类型
关键字 | 位数 | 表示范围 | stdint关键字 | ST关键字 |
---|---|---|---|---|
unsigned char | 8 | 0 ~ 255 | uint8_t | u8 |
char | 8 | -128 ~ 127 | int8_t | s8 |
unsigned short | 16 | 0 ~ 65535 | uint16_t | u16 |
short | 16 | -32768 ~ 32767 | int16_t | s16 |
unsigned int | 32 | 0 ~ 4294967295 | uint32_t | u32 |
int | 32 | -2147483648 ~ 2147483647 | int32_t | s32 |
unsigned long | 32 | 0 ~ 4294967295 | ||
long | 32 | -2147483648 ~ 2147483647 | ||
unsigned long long | 64 | 0 ~ (2^64)-1 | uint64_t | |
long long | 64 | -(2^64)/2 ~ (2^64)/2-1 | int64_t | |
float | 32 | -3.4e38 ~ 3.4e38 | ||
double | 64 | -1.7e308 ~ 1.7e308 |