◐ Shell
reader mode source ↗
来自cppreference.com


 
 
标准库头
 

此标头原作为 <inttypes.h> 存在于 C 标准库。

包含

(C++11)
定宽整数类型其他类型的极限[编辑]

类型

(C++11)
std::imaxdiv 返回的结构体类型
(typedef) [编辑]

函数

计算整数的绝对值(\(\small{|x|}\)|x|
(函数) [编辑]
计算整数除法的商和余数
(函数) [编辑]
(C++11)(C++11)
转换字节字符串为 std::intmax_tstd::uintmax_t
(函数) [编辑]
(C++11)(C++11)
转换宽字符串为 std::intmax_tstd::uintmax_t
(函数) [编辑]

std::fprintf 函数族的格式常量
PRIdNPRIdLEASTNPRIdFASTNPRIdMAXPRIdPTR
(C++11)
格式转换说明符,分别用于输出 std::intN_tstd::int_leastN_tstd::int_fastN_tstd::intmax_tstd::intptr_t 类型的有符号十进制整数值,等价于对于 intd
(宏常量)
PRIiNPRIiLEASTNPRIiFASTNPRIiMAXPRIiPTR
(C++11)
格式转换说明符,分别用于输出 std::intN_tstd::int_leastN_tstd::int_fastN_tstd::intmax_tstd::intptr_t 类型的有符号十进制整数值,等价于对于 inti
(宏常量)
PRIuNPRIuLEASTNPRIuFASTNPRIuMAXPRIuPTR
(C++11)
格式转换说明符,分别用于输出 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号十进制整数值,等价于对于 unsigned intu
(宏常量)
PRIoNPRIoLEASTNPRIoFASTNPRIoMAXPRIoPTR
(C++11)
格式转换说明符,分别用于输出 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号八进制整数值,等价于对于 unsigned into
(宏常量)
PRIxNPRIxLEASTNPRIxFASTNPRIxMAXPRIxPTR
(C++11)
格式转换说明符,分别用于输出 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号小写十六进制整数值,等价于对于 unsigned intx
(宏常量)
PRIXNPRIXLEASTNPRIXFASTNPRIXMAXPRIXPTR
(C++11)
格式转换说明符,分别用于输出 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号大写十六进制整数值,等价于对于 unsigned intX
(宏常量)
PRIbNPRIbLEASTNPRIbFASTNPRIbMAXPRIbPTR
(C++26)
格式转换说明符,分别用于输出 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号小写二进制整数值,等价于对于 unsigned intb
(宏常量)
PRIBNPRIBLEASTNPRIBFASTNPRIBMAXPRIBPTR
(C++26)(有条件提供)
格式转换说明符,分别用于输出 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号大写二进制整数值,等价于对于 unsigned intB
(当且仅当 std::fprintf 支持转换说明符 B 时才会定义)
(宏常量)
std::fscanf 函数族的格式常量
SCNdNSCNdNSCNdNSCNdMAXSCNdPTR
(C++11)
格式转换说明符,分别用于输入 std::intN_tstd::int_leastN_tstd::int_fastN_tstd::intmax_tstd::intptr_t 类型的有符号十进制整数值,等价于对于 intd
(宏常量)
SCNiNSCNiNSCNiNSCNiMAXSCNiPTR
(C++11)
格式转换说明符,分别用于输入 std::intN_tstd::int_leastN_tstd::int_fastN_tstd::intmax_tstd::intptr_t 类型的有符号十进制/八进制/十六进制整数值,等价于对于 inti
(宏常量)
SCNuNSCNuNSCNuNSCNuMAXSCNuPTR
(C++11)
格式转换说明符,分别用于输入 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号十进制整数值,等价于对于 unsigned intu
(宏常量)
SCNoNSCNoNSCNoNSCNoMAXSCNoPTR
(C++11)
格式转换说明符,分别用于输入 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号八进制整数值,等价于对于 unsigned into
(宏常量)
SCNxNSCNxNSCNxNSCNxMAXSCNxPTR
(C++11)
格式转换说明符,分别用于输入 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号十六进制整数值,等价于对于 unsigned intx
(宏常量)
SCNbNSCNbNSCNbNSCNbMAXSCNbPTR
(C++26)
格式转换说明符,分别用于输入 std::uintN_tstd::uint_leastN_tstd::uint_fastN_tstd::uintmax_tstd::uintptr_t 类型的无符号二进制整数值,等价于对于 unsigned intb
(宏常量)

概要

#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 /* 见描述 */