C++ Reference: Standard C++ Library reference: C Library: cstdint

C++ 头文件提供了具有特定宽度的整数类型别名和相关宏,确保不同平台上的整数类型有固定的位宽。头文件还包含了一些用于创建这些类型值的宏函数。此标准库允许开发者编写更可移植的代码,定义的类型包括有符号和无符号整数,如 int8_t、uint32_t 等。同时,还提供了如 INTMAX_C() 之类的宏,用于创建整数常量。
摘要由CSDN通过智能技术生成

C++官网参考链接:https://cplusplus.com/reference/cstdint/

头文件
<cstdint> (stdint.h)
整数类型
该头文件定义了一组具有特定宽度要求的整型类型别名,以及指定其限制的宏和创建这些类型值的宏函数。 

类型
以下是基本整型或扩展整型的类型定义。

signed type unsigned type description
intmax_t uintmax_t

Integer type with the maximum width supported.

(支持最大宽度的整数类型。)

int8_t uint8_t

Integer type with a width of exactly 8, 16, 32, or 64 bits.
For signed types, negative values are represented using 2's complement.
No padding bits.
Optional: These typedefs are not defined if no types with such characteristics exist.*

(宽度为8、16、32或64位的整数类型。

对于有符号类型,负数用2的补码表示。

没有填充位。

可选的:如果不存在具有此类特征的类型,则不定义这些类型。)

int16_t uint16_t
int32_t uint32_t
int64_t uint64_t
int_least8_t uint_least8_t

Integer type with a minimum of 8, 16, 32, or 64 bits.
No other integer type exists with lesser size and at least the specified width.

(最小值为

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

weixin_40186813

你的能量无可限量。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值