型態 uint8_t, uint16_t, uint32_t, uint64_t分別可以對照成
型態 usigned char, unsigned short, unsigned int, unsigned long long
那麼他們各自的範圍又是如何呢?
uint8_t為0~2^8-1 (0x00~0xFF)
uint16_t為0~2^16-1 (0x0000~0xFFFF)
uint32_t為0~2^32-1 (0x00000000~0xFFFFFFFF)
uint64_t為0~2^64-1 (0x0000000000000000~0xFFFFFFFFFFFFFFFF)
https://pinglinblog.wordpress.com/2014/01/16/ctype-uint8_t-uint16_t-uint32_t-uint64_t/
uint8 : 0 ~ 255
uint16 : 0 ~ 65535
uint32 : 0 ~ 4294967295
uint64 : 0 ~ 18446744073709551615
int8 : -128 ~ 127
int16 : -32768 ~ 32767
int32 : -2147483648 ~ 2147483647
int64 : -9223372036854775808 ~ 9223372036854775807
文章標籤
全站熱搜
留言列表