标准库标头 <cinttypes> (C++11) - cppreference.com
来自cppreference.com
此标头原作为 <inttypes.h> 存在于 C 标准库。
包含 | |
(C++11) |
定宽整数类型与其他类型的极限[编辑] |
类型 | |
(C++11) |
std::imaxdiv 返回的结构体类型 (typedef) [编辑] |
函数 | |
(C++11)(C++11) |
计算整数的绝对值(|x|) (函数) [编辑] |
(C++11)(C++11) |
计算整数除法的商和余数 (函数) [编辑] |
(C++11)(C++11) |
转换字节字符串为 std::intmax_t 或 std::uintmax_t (函数) [编辑] |
(C++11)(C++11) |
转换宽字符串为 std::intmax_t 或 std::uintmax_t (函数) [编辑] |
宏 | |
std::fprintf 函数族的格式常量 | |
PRIdNPRIdLEASTNPRIdFASTNPRIdMAXPRIdPTR (C++11) |
格式转换说明符,分别用于输出 std::intN_t、std::int_leastN_t、std::int_fastN_t、std::intmax_t、std::intptr_t 类型的有符号十进制整数值,等价于对于 int 的 d (宏常量) |
PRIiNPRIiLEASTNPRIiFASTNPRIiMAXPRIiPTR (C++11) |
格式转换说明符,分别用于输出 std::intN_t、std::int_leastN_t、std::int_fastN_t、std::intmax_t、std::intptr_t 类型的有符号十进制整数值,等价于对于 int 的 i (宏常量) |
PRIuNPRIuLEASTNPRIuFASTNPRIuMAXPRIuPTR (C++11) |
格式转换说明符,分别用于输出 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号十进制整数值,等价于对于 unsigned int 的 u (宏常量) |
PRIoNPRIoLEASTNPRIoFASTNPRIoMAXPRIoPTR (C++11) |
格式转换说明符,分别用于输出 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号八进制整数值,等价于对于 unsigned int 的 o (宏常量) |
PRIxNPRIxLEASTNPRIxFASTNPRIxMAXPRIxPTR (C++11) |
格式转换说明符,分别用于输出 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号小写十六进制整数值,等价于对于 unsigned int 的 x (宏常量) |
PRIXNPRIXLEASTNPRIXFASTNPRIXMAXPRIXPTR (C++11) |
格式转换说明符,分别用于输出 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号大写十六进制整数值,等价于对于 unsigned int 的 X (宏常量) |
PRIbNPRIbLEASTNPRIbFASTNPRIbMAXPRIbPTR (C++26) |
格式转换说明符,分别用于输出 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号小写二进制整数值,等价于对于 unsigned int 的 b (宏常量) |
PRIBNPRIBLEASTNPRIBFASTNPRIBMAXPRIBPTR (C++26)(有条件提供) |
格式转换说明符,分别用于输出 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号大写二进制整数值,等价于对于 unsigned int 的 B(当且仅当 std::fprintf 支持转换说明符 B 时才会定义) (宏常量) |
std::fscanf 函数族的格式常量 | |
SCNdNSCNdNSCNdNSCNdMAXSCNdPTR (C++11) |
格式转换说明符,分别用于输入 std::intN_t、std::int_leastN_t、std::int_fastN_t、std::intmax_t、std::intptr_t 类型的有符号十进制整数值,等价于对于 int 的 d (宏常量) |
SCNiNSCNiNSCNiNSCNiMAXSCNiPTR (C++11) |
格式转换说明符,分别用于输入 std::intN_t、std::int_leastN_t、std::int_fastN_t、std::intmax_t、std::intptr_t 类型的有符号十进制/八进制/十六进制整数值,等价于对于 int 的 i (宏常量) |
SCNuNSCNuNSCNuNSCNuMAXSCNuPTR (C++11) |
格式转换说明符,分别用于输入 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号十进制整数值,等价于对于 unsigned int 的 u (宏常量) |
SCNoNSCNoNSCNoNSCNoMAXSCNoPTR (C++11) |
格式转换说明符,分别用于输入 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号八进制整数值,等价于对于 unsigned int 的 o (宏常量) |
SCNxNSCNxNSCNxNSCNxMAXSCNxPTR (C++11) |
格式转换说明符,分别用于输入 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号十六进制整数值,等价于对于 unsigned int 的 x (宏常量) |
SCNbNSCNbNSCNbNSCNbMAXSCNbPTR (C++26) |
格式转换说明符,分别用于输入 std::uintN_t、std::uint_leastN_t、std::uint_fastN_t、std::uintmax_t、std::uintptr_t 类型的无符号二进制整数值,等价于对于 unsigned int 的 b (宏常量) |
概要
#include <cstdint> #define __STDC_VERSION_INTTYPES_H__ 202311L namespace std { using imaxdiv_t = /* 见描述 */; constexpr intmax_t imaxabs(intmax_t j); constexpr imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); intmax_t strtoimax(const char* nptr, char** endptr, int base); uintmax_t strtoumax(const char* nptr, char** endptr, int base); intmax_t wcstoimax(const wchar_t* nptr, wchar_t** endptr, int base); uintmax_t wcstoumax(const wchar_t* nptr, wchar_t** endptr, int base); constexpr intmax_t abs(intmax_t); // 可选,见描述 constexpr imaxdiv_t div(intmax_t, intmax_t); // 可选,见描述 } #define PRIdN /* 见描述 */ #define PRIiN /* 见描述 */ #define PRIoN /* 见描述 */ #define PRIuN /* 见描述 */ #define PRIxN /* 见描述 */ #define PRIXN /* 见描述 */ #define PRIbN /* 见描述 */ #define PRIBN /* 见描述 */ #define SCNdN /* 见描述 */ #define SCNiN /* 见描述 */ #define SCNoN /* 见描述 */ #define SCNuN /* 见描述 */ #define SCNxN /* 见描述 */ #define SCNbN /* 见描述 */ #define PRIdLEASTN /* 见描述 */ #define PRIiLEASTN /* 见描述 */ #define PRIoLEASTN /* 见描述 */ #define PRIuLEASTN /* 见描述 */ #define PRIxLEASTN /* 见描述 */ #define PRIXLEASTN /* 见描述 */ #define PRIbLEASTN /* 见描述 */ #define PRIBLEASTN /* 见描述 */ #define SCNdLEASTN /* 见描述 */ #define SCNiLEASTN /* 见描述 */ #define SCNoLEASTN /* 见描述 */ #define SCNuLEASTN /* 见描述 */ #define SCNxLEASTN /* 见描述 */ #define SCNbLEASTN /* 见描述 */ #define PRIdFASTN /* 见描述 */ #define PRIiFASTN /* 见描述 */ #define PRIoFASTN /* 见描述 */ #define PRIuFASTN /* 见描述 */ #define PRIxFASTN /* 见描述 */ #define PRIXFASTN /* 见描述 */ #define PRIbFASTN /* 见描述 */ #define PRIBFASTN /* 见描述 */ #define SCNdFASTN /* 见描述 */ #define SCNiFASTN /* 见描述 */ #define SCNoFASTN /* 见描述 */ #define SCNuFASTN /* 见描述 */ #define SCNxFASTN /* 见描述 */ #define SCNbFASTN /* 见描述 */ #define PRIdMAX /* 见描述 */ #define PRIiMAX /* 见描述 */ #define PRIoMAX /* 见描述 */ #define PRIuMAX /* 见描述 */ #define PRIxMAX /* 见描述 */ #define PRIXMAX /* 见描述 */ #define PRIbMAX /* 见描述 */ #define PRIBMAX /* 见描述 */ #define SCNdMAX /* 见描述 */ #define SCNiMAX /* 见描述 */ #define SCNoMAX /* 见描述 */ #define SCNuMAX /* 见描述 */ #define SCNxMAX /* 见描述 */ #define SCNbMAX /* 见描述 */ #define PRIdPTR /* 见描述 */ #define PRIiPTR /* 见描述 */ #define PRIoPTR /* 见描述 */ #define PRIuPTR /* 见描述 */ #define PRIxPTR /* 见描述 */ #define PRIXPTR /* 见描述 */ #define PRIbPTR /* 见描述 */ #define PRIBPTR /* 见描述 */ #define SCNdPTR /* 见描述 */ #define SCNiPTR /* 见描述 */ #define SCNoPTR /* 见描述 */ #define SCNuPTR /* 见描述 */ #define SCNxPTR /* 见描述 */ #define SCNbPTR /* 见描述 */