标准库标头 <cstdint> (C++11) - cppreference.com

标准库标头 <cstdint> (C++11)

来自cppreference.com


 
 
标准库头
通用工具
<any> (C++17)
<bitset>
<bit> (C++20)
<charconv> (C++17)
<expected> (C++23)
<format> (C++20)
<functional>
<optional> (C++17)
<stdbit.h> (C++26)
<tuple> (C++11)
<typeindex> (C++11)
<utility>
<variant> (C++17)
容器
<array> (C++11)
<deque>
<flat_map> (C++23)
<flat_set> (C++23)
<forward_list> (C++11)
<hive> (C++26)
<inplace_vector> (C++26)   
<list>
<map>
<mdspan> (C++23)
<queue>
<set>
<span> (C++20)
<stack>
<unordered_map> (C++11)
<unordered_set> (C++11)
<vector>
迭代器
<iterator>
范围
<generator> (C++23)
<ranges> (C++20)
 

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

此头文件是类型支持库的一部分,提供定宽整数类型和部分 C 数值极限接口

概要

namespace std {
  using int8_t         = /* 有符号整数类型 */; // 可选
  using int16_t        = /* 有符号整数类型 */; // 可选
  using int32_t        = /* 有符号整数类型 */; // 可选
  using int64_t        = /* 有符号整数类型 */; // 可选
  using intN_t         = /* 见描述 */;       // 可选,见描述
 
  using int_fast8_t    = /* 有符号整数类型 */;
  using int_fast16_t   = /* 有符号整数类型 */;
  using int_fast32_t   = /* 有符号整数类型 */;
  using int_fast64_t   = /* 有符号整数类型 */;
  using int_fastN_t    = /* 见描述 */;       // 可选,见描述
 
  using int_least8_t   = /* 有符号整数类型 */;
  using int_least16_t  = /* 有符号整数类型 */;
  using int_least32_t  = /* 有符号整数类型 */;
  using int_least64_t  = /* 有符号整数类型 */;
  using int_leastN_t   = /* 见描述 */;       // 可选,见描述
 
  using intmax_t       = /* 有符号整数类型 */;
  using intptr_t       = /* 有符号整数类型 */; // 可选
 
  using uint8_t        = /* 无符号整数类型 */; // 可选
  using uint16_t       = /* 无符号整数类型 */; // 可选
  using uint32_t       = /* 无符号整数类型 */; // 可选
  using uint64_t       = /* 无符号整数类型 */; // 可选
  using uintN_t        = /* 见描述 */;       // 可选,见描述
 
  using uint_fast8_t   = /* 无符号整数类型 */;
  using uint_fast16_t  = /* 无符号整数类型 */;
  using uint_fast32_t  = /* 无符号整数类型 */;
  using uint_fast64_t  = /* 无符号整数类型 */;
  using uint_fastN_t   = /* 见描述 */;       // 可选,见描述
 
  using uint_least8_t  = /* 无符号整数类型 */;
  using uint_least16_t = /* 无符号整数类型 */;
  using uint_least32_t = /* 无符号整数类型 */;
  using uint_least64_t = /* 无符号整数类型 */;
  using uint_leastN_t  = /* 见描述 */;       // 可选,见描述
 
  using uintmax_t      = /* 无符号整数类型 */;
  using uintptr_t      = /* 无符号整数类型 */; // 可选
}
 
#define INTN_MIN         /* 见描述 */
#define INTN_MAX         /* 见描述 */
#define UINTN_MAX        /* 见描述 */
 
#define INT_FASTN_MIN    /* 见描述 */
#define INT_FASTN_MAX    /* 见描述 */
#define UINT_FASTN_MAX   /* 见描述 */
 
#define INT_LEASTN_MIN   /* 见描述 */
#define INT_LEASTN_MAX   /* 见描述 */
#define UINT_LEASTN_MAX  /* 见描述 */
 
#define INTMAX_MIN       /* 见描述 */
#define INTMAX_MAX       /* 见描述 */
#define UINTMAX_MAX      /* 见描述 */
 
#define INTPTR_MIN       /* 见描述 */         // 可选
#define INTPTR_MAX       /* 见描述 */         // 可选
#define UINTPTR_MAX      /* 见描述 */         // 可选
 
#define PTRDIFF_MIN      /* 见描述 */
#define PTRDIFF_MAX      /* 见描述 */
#define SIZE_MAX         /* 见描述 */
 
#define SIG_ATOMIC_MIN   /* 见描述 */
#define SIG_ATOMIC_MAX   /* 见描述 */
 
#define WCHAR_MIN        /* 见描述 */
#define WCHAR_MAX        /* 见描述 */
 
#define WINT_MIN         /* 见描述 */
#define WINT_MAX         /* 见描述 */
 
#define INTN_C(value)    /* 见描述 */
#define UINTN_C(value)   /* 见描述 */
#define INTMAX_C(value)  /* 见描述 */
#define UINTMAX_C(value) /* 见描述 */