Integer Types Range and varieties

Fixed-Width Integer Types (<cstdint> / <stdint.h>)

These are portable and recommended for predictable behavior.

TypeSizeSigned RangeUnsigned Range
int8_t8 bits-128 to 127
uint8_t8 bits0 to 255
int16_t16 bits-32,768 to 32,767
uint16_t16 bits0 to 65,535
int32_t32 bits-2,147,483,648 to 2,147,483,647
uint32_t32 bits0 to 4,294,967,295
int64_t64 bits-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
uint64_t64 bits0 to 18,446,744,073,709,551,615

Standard C++ Integer Types (<limits>)

TypeTypical Size (LP64)Signed RangeUnsigned Range
char8 bits-128 to 127 (if char is signed)0 to 255 (if char is unsigned)
signed char8 bits-128 to 127
unsigned char8 bits0 to 255
short16 bits-32,768 to 32,7670 to 65,535
unsigned short16 bits0 to 65,535
int32 bits-2,147,483,648 to 2,147,483,6470 to 4,294,967,295
unsigned int32 bits0 to 4,294,967,295
long64 bits-9,223,372,036,854,775,808 to 9,223,372,036,854,775,8070 to 18,446,744,073,709,551,615
unsigned long64 bits0 to 18,446,744,073,709,551,615
long long64 bitsSame as longSame as unsigned long
unsigned long long64 bitsSame as unsigned long
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值