头文件<cstdint>的C++11标准

本文详细介绍了C++中各种整型数据类型,包括intmax_t、uintmax_t、int8_t到int64_t等,涵盖了固定宽度、最小宽度、最快类型以及用于指针操作的整型。文中强调了这些类型在命名空间std内的定义,并建议在C++11及以后的环境中使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

C++中头文件是定义数据类型的文件,文件中的数据类型定义在命名空间std内,一般要在C++11及以后的环境中使用。使用其数据类型时,最好加上命名空间的前缀“std::int64".避免在全局使用using namespace std;或者为了避免污染全局命名空间,可以另外定义命名空间进行隔离。

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.*
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.
int_least16_t uint_least16_t
int_least32_t uint_least32_t
int_least64_t uint_least64_t
int_fast8_t uint_fast8_t Integer type with a minimum of 8, 16, 32, or 64 bits.
At least as fast as any other integer type with at least the specified width.
int_fast16_t uint_fast16_t
int_fast32_t uint_fast32_t
int_fast64_t uint_fast64_t
intptr_t uintptr_t Integer type capable of holding a value converted from a void pointer and then be converted back to that type with a value that compares equal to the original pointer.
Optional: These typedefs may not be defined in some library implementations.*

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值