Fixed width integer types (C++11起)
来自cppreference.com
![]() |
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
[编辑] 类型
定义于头文件
<cstdint> | |
int8_t int16_t int32_t int64_t
|
有符号整数类型宽度of
正好是8,16,32和64位respectively with有填充比特,并使用2的补负values (仅当实现直接支持的类型) 原文: signed integer type with width of exactly 8, 16, 32 and 64 bits respectively with no padding bits and using 2's complement for negative values (provided only if the implementation directly supports the type) |
int_fast8_t int_fast16_t int_fast32_t int_fast64_t
|
最快的签署有符号整数类型宽度of
至少为8,16,32和64位分别 原文: fastest signed signed integer type with width of at least 8, 16, 32 and 64 bits respectively |
int_least8_t int_least16_t int_least32_t int_least64_t
|
最小的有符号整数类型宽度of
至少为8,16,32和64位分别 原文: smallest signed integer type with width of at least 8, 16, 32 and 64 bits respectively |
intmax_t
|
最大宽度整数类型
|
intptr_t
|
整数类型的能够举行一个指针
原文: integer type capable of holding a pointer |
uint8_t uint16_t uint32_t uint64_t
|
宽度的无符号整数类型of
正好是8,16,32和64位分别 (仅当实现直接支持的类型) 原文: unsigned integer type with width of exactly 8, 16, 32 and 64 bits respectively (provided only if the implementation directly supports the type) |
uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
|
最快的无符号的无符号整数类型宽度of
至少为8,16,32和64位分别 原文: fastest unsigned unsigned integer type with width of at least 8, 16, 32 and 64 bits respectively |
uint_least8_t uint_least16_t uint_least32_t uint_least64_t
|
最小宽度of
至少为8,16,32和64位分别为无符号整数类型 原文: smallest unsigned integer type with width of at least 8, 16, 32 and 64 bits respectively |
uintmax_t
|
最大宽度的无符号整数类型
原文: maximum width unsigned integer type |
uintptr_t
|
无符号整数类型,能够举行一个指针
原文: unsigned integer type capable of holding a pointer |
[编辑] 宏常量
定义于头文件
<cstdint> | |
| |
INT8_MIN INT16_MIN INT32_MIN INT64_MIN |
最低值类型的对象int8_t,int16_t,int32_t,int64_t 原文: minimum value of an object of type int8_t, int16_t, int32_t, int64_t (宏常量) |
INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN |
最低值类型的对象int_fast8_t,int_fast16_t,int_fast32_t,int_fast64_t 原文: minimum value of an object of type int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t (宏常量) |
INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN |
最低值类型的对象int_least8_t,int_least16_t,int_least32_t,int_least64_t 原文: minimum value of an object of type int_least8_t, int_least16_t, int_least32_t, int_least64_t (宏常量) |
INTPTR_MIN |
intptr_t类型的对象的最低值 原文: minimum value of an object of type intptr_t (宏常量) |
INTMAX_MIN |
intmax_t类型的对象的最低值 原文: minimum value of an object of type intmax_t (宏常量) |
| |
INT8_MAX INT16_MAX INT32_MAX INT64_MAX |
int8_t类型的对象的最大值,int16_t,int32_t,int64_t 原文: maximum value of an object of type int8_t, int16_t, int32_t, int64_t (宏常量) |
INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX |
int_fast8_t类型的对象的最大值,int_fast16_t,int_fast32_t,int_fast64_t 原文: maximum value of an object of type int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t (宏常量) |
INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX |
int_least8_t类型的对象的最大值,int_least16_t,int_least32_t,int_least64_t 原文: maximum value of an object of type int_least8_t, int_least16_t, int_least32_t, int_least64_t (宏常量) |
INTPTR_MAX |
intptr_t类型的对象的最大值 原文: maximum value of an object of type intptr_t (宏常量) |
INTMAX_MAX |
intmax_t类型的对象的最大值 原文: maximum value of an object of type intmax_t (宏常量) |
| |
UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX |
uint8_t类型的对象的最大值,uint16_t,uint32_t,uint64_t 原文: maximum value of an object of type uint8_t, uint16_t, uint32_t, uint64_t (宏常量) |
UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX |
uint_fast8_t类型的对象的最大值,uint_fast16_t,uint_fast32_t,uint_fast64_t 原文: maximum value of an object of type uint_fast8_t, uint_fast16_t, uint_fast32_t, uint_fast64_t (宏常量) |
UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX |
uint_least8_t类型的对象的最大值,uint_least16_t,uint_least32_t,uint_least64_t 原文: maximum value of an object of type uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t (宏常量) |
UINTPTR_MAX |
uintptr_t类型的对象的最大值 原文: maximum value of an object of type uintptr_t (宏常量) |
UINTMAX_MAX |
uintmax_t类型的对象的最大值 原文: maximum value of an object of type uintmax_t (宏常量) |
[编辑] 格式宏常量
本章尚未完成 原因:will look better as a table |
定义于头文件
<cinttypes> | |
原文: Format constants for the std::fprintf family of functions | |
PRId8 PRId16 PRId32 PRId64 PRIdLEAST8 PRIdLEAST16 PRIdLEAST32 PRIdLEAST64 PRIdFAST8 PRIdFAST16 PRIdFAST32 PRIdFAST64 PRIdMAX PRIdPTR |
输出格式转换符有符号十进制整数类型的值std::int8_t,std::int16_t,std::int32_t,std::int64_t,std::int_least8_t,std::int_least16_t,std::int_least32_t,std::int_least64_t,std::int_fast8_t,std::int_fast16_t,std::int_fast32_t,std::int_fast64_t,std:intmax_t,std::intptr_t分别相当于 %d 为int 原文: format conversion specifier to output a signed decimal integer value of type std::int8_t, std::int16_t, std::int32_t, std::int64_t, std::int_least8_t, std::int_least16_t, std::int_least32_t, std::int_least64_t, std::int_fast8_t, std::int_fast16_t, std::int_fast32_t, std::int_fast64_t, std:intmax_t, std::intptr_t respectively, equivalent to %d for int (宏常量) |
PRIi8 PRIi16 PRIi32 PRIi64 PRIiLEAST8 PRIiLEAST16 PRIiLEAST32 PRIiLEAST64 PRIiFAST8 PRIiFAST16 PRIiFAST32 PRIiFAST64 PRIiMAX PRIiPTR |
输出格式转换符有符号十进制整数类型的值std::int8_t,std::int16_t,std::int32_t,std::int64_t,std::int_least8_t,std::int_least16_t,std::int_least32_t,std::int_least64_t,std::int_fast8_t,std::int_fast16_t,std::int_fast32_t,std::int_fast64_t,std:intmax_t,std::intptr_t分别相当于 %i 为int 原文: format conversion specifier to output a signed decimal integer value of type std::int8_t, std::int16_t, std::int32_t, std::int64_t, std::int_least8_t, std::int_least16_t, std::int_least32_t, std::int_least64_t, std::int_fast8_t, std::int_fast16_t, std::int_fast32_t, std::int_fast64_t, std:intmax_t, std::intptr_t respectively, equivalent to %i for int (宏常量) |
PRIu8 PRIu16 PRIu32 PRIu64 PRIuLEAST8 PRIuLEAST16 PRIuLEAST32 PRIuLEAST64 PRIuFAST8 PRIuFAST16 PRIuFAST32 PRIuFAST64 PRIuMAX PRIuPTR |
格式转换说明符来输出一个无符号整数类型的值std::uint8_t,std::uint16_t,std::uint32_t,std::uint64_t,std::uint_least8_t,std::uint_least16_t,std::uint_least32_t,std::uint_least64_t,std::uint_fast8_t,std::uint_fast16_t,std::uint_fast32_t,std::uint_fast64_t,std:uintmax_t,std::uintptr_t分别相当于 %u 为unsigned int 原文: format conversion specifier to output an unsigned decimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %u for unsigned int (宏常量) |
PRIo8 PRIo16 PRIo32 PRIo64 PRIoLEAST8 PRIoLEAST16 PRIoLEAST32 PRIoLEAST64 PRIoFAST8 PRIoFAST16 PRIoFAST32 PRIoFAST64 PRIoMAX PRIoPTR |
格式转换说明符来输出一个无符号的八进制整数类型的值std::uint8_t,std::uint16_t,std::uint32_t,std::uint64_t,std::uint_least8_t,std::uint_least16_t,std::uint_least32_t,std::uint_least64_t,std::uint_fast8_t,std::uint_fast16_t,std::uint_fast32_t,std::uint_fast64_t,std:uintmax_t,std::uintptr_t分别相当于 %o 为unsigned int 原文: format conversion specifier to output an unsigned octal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %o for unsigned int (宏常量) |
PRIx8 PRIx16 PRIx32 PRIx64 PRIxLEAST8 PRIxLEAST16 PRIxLEAST32 PRIxLEAST64 PRIxFAST8 PRIxFAST16 PRIxFAST32 PRIxFAST64 PRIxMAX PRIxPTR |
格式转换说明符来输出一个无符号的十六进制整数类型的值std::uint8_t,std::uint16_t,std::uint32_t,std::uint64_t,std::uint_least8_t,std::uint_least16_t,std::uint_least32_t,std::uint_least64_t,std::uint_fast8_t,std::uint_fast16_t,std::uint_fast32_t,std::uint_fast64_t,std:uintmax_t,std::uintptr_t分别相当于 %x 为unsigned int 原文: format conversion specifier to output an unsigned hexadecimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %x for unsigned int (宏常量) |
PRIX8 PRIX16 PRIX32 PRIX64 PRIXLEAST8 PRIXLEAST16 PRIXLEAST32 PRIXLEAST64 PRIXFAST8 PRIXFAST16 PRIXFAST32 PRIXFAST64 PRIXMAX PRIXPTR |
格式转换说明符来输出一个无符号的大写十六进制整数类型的值std::uint8_t,std::uint16_t,std::uint32_t,std::uint64_t,std::uint_least8_t,std::uint_least16_t,std::uint_least32_t,std::uint_least64_t,std::uint_fast8_t,std::uint_fast16_t,std::uint_fast32_t,std::uint_fast64_t,std:uintmax_t,std::uintptr_t分别相当于 %X 为unsigned int 原文: format conversion specifier to output an unsigned uppercase hexadecimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %X for unsigned int (宏常量) |
原文: Format constants for the std::fscanf family of functions | |
SCNd8 SCNd16 SCNd32 SCNd64 SCNdLEAST8 SCNdLEAST16 SCNdLEAST32 SCNdLEAST64 SCNdFAST8 SCNdFAST16 SCNdFAST32 SCNdFAST64 SCNdMAX SCNdPTR |
格式转换说明符的输入有符号十进制整数类型的值std::int8_t,std::int16_t,std::int32_t,std::int64_t,std::int_least8_t,std::int_least16_t,std::int_least32_t,std::int_least64_t,std::int_fast8_t,std::int_fast16_t,std::int_fast32_t,std::int_fast64_t,std:intmax_t,std::intptr_t分别相当于 %d 为int 原文: format conversion specifier to input a signed decimal integer value of type std::int8_t, std::int16_t, std::int32_t, std::int64_t, std::int_least8_t, std::int_least16_t, std::int_least32_t, std::int_least64_t, std::int_fast8_t, std::int_fast16_t, std::int_fast32_t, std::int_fast64_t, std:intmax_t, std::intptr_t respectively, equivalent to %d for int (宏常量) |
SCNi8 SCNi16 SCNi32 SCNi64 SCNiLEAST8 SCNiLEAST16 SCNiLEAST32 SCNiLEAST64 SCNiFAST8 SCNiFAST16 SCNiFAST32 SCNiFAST64 SCNiMAX SCNiPTR |
格式转换说明std::int8_t,std::int16_t,std::int32_t,std::int64_t,std::int_least8_t,std::int_least16_t,std::int_least32_t,std::int_least64_t,std::int_fast8_t,std::int_fast16_t,std::int_fast32_t,std::int_fast64_t,std:intmax_t,std::intptr_t分别输入有符号十进制/八进制/十六进制整数类型的值,相当于 %i int 原文: format conversion specifier to input a signed decimal/octal/hexadecimal integer value of type std::int8_t, std::int16_t, std::int32_t, std::int64_t, std::int_least8_t, std::int_least16_t, std::int_least32_t, std::int_least64_t, std::int_fast8_t, std::int_fast16_t, std::int_fast32_t, std::int_fast64_t, std:intmax_t, std::intptr_t respectively, equivalent to %i for int (宏常量) |
SCNu8 SCNu16 SCNu32 SCNu64 SCNuLEAST8 SCNuLEAST16 SCNuLEAST32 SCNuLEAST64 SCNuFAST8 SCNuFAST16 SCNuFAST32 SCNuFAST64 SCNuMAX SCNuPTR |
格式转换说明输入一个无符号整数类型的值std::uint8_t,std::uint16_t,std::uint32_t,std::uint64_t,std::uint_least8_t,std::uint_least16_t,std::uint_least32_t,std::uint_least64_t,std::uint_fast8_t,std::uint_fast16_t,std::uint_fast32_t,std::uint_fast64_t,std:uintmax_t,std::uintptr_t分别相当于 %u 为unsigned int 原文: format conversion specifier to input an unsigned decimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %u for unsigned int (宏常量) |
SCNo8 SCNo16 SCNo32 SCNo64 SCNoLEAST8 SCNoLEAST16 SCNoLEAST32 SCNoLEAST64 SCNoFAST8 SCNoFAST16 SCNoFAST32 SCNoFAST64 SCNoMAX SCNoPTR |
格式转换说明输入一个无符号的八进制整数类型的值std::uint8_t,std::uint16_t,std::uint32_t,std::uint64_t,std::uint_least8_t,std::uint_least16_t,std::uint_least32_t,std::uint_least64_t,std::uint_fast8_t,std::uint_fast16_t,std::uint_fast32_t,std::uint_fast64_t,std:uintmax_t,std::uintptr_t分别相当于 %o 为unsigned int 原文: format conversion specifier to input an unsigned octal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %o for unsigned int (宏常量) |
SCNx8 SCNx16 SCNx32 SCNx64 SCNxLEAST8 SCNxLEAST16 SCNxLEAST32 SCNxLEAST64 SCNxFAST8 SCNxFAST16 SCNxFAST32 SCNxFAST64 SCNxMAX SCNxPTR |
格式转换说明输入一个无符号的十六进制整数类型的值std::uint8_t,std::uint16_t,std::uint32_t,std::uint64_t,std::uint_least8_t,std::uint_least16_t,std::uint_least32_t,std::uint_least64_t,std::uint_fast8_t,std::uint_fast16_t,std::uint_fast32_t,std::uint_fast64_t,std:uintmax_t,std::uintptr_t分别相当于 %x 为unsigned int 原文: format conversion specifier to input an unsigned hexadecimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %x for unsigned int (宏常量) |
SCNX8 SCNX16 SCNX32 SCNX64 SCNXLEAST8 SCNXLEAST16 SCNXLEAST32 SCNXLEAST64 SCNXFAST8 SCNXFAST16 SCNXFAST32 SCNXFAST64 SCNXMAX SCNXPTR |
格式转换说明输入大写十六进制的无符号整数类型的值std::uint8_t,std::uint16_t,std::uint32_t,std::uint64_t,std::uint_least8_t,std::uint_least16_t,std::uint_least32_t,std::uint_least64_t,std::uint_fast8_t,std::uint_fast16_t,std::uint_fast32_t,std::uint_fast64_t,std:uintmax_t,std::uintptr_t分别相当于 %X 为unsigned int 原文: format conversion specifier to input an unsigned uppercase hexadecimal integer value of type std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t, std::uint_least8_t, std::uint_least16_t, std::uint_least32_t, std::uint_least64_t, std::uint_fast8_t, std::uint_fast16_t, std::uint_fast32_t, std::uint_fast64_t, std:uintmax_t, std::uintptr_t respectively, equivalent to %X for unsigned int (宏常量) |