名稱空間
變體
操作

標準庫標頭檔案 <cstdint> (C++11)

來自 cppreference.com
 
 
標準庫標頭檔案
演算法
<algorithm>
<numeric>
字串
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
文字處理
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
數值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<valarray>
時間
<chrono> (C++11)
<ctime>
C 相容性
<ccomplex> (C++11/17/20*)
<ciso646> (直到 C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

此標頭檔案最初是 C 標準庫的一部分,名為 <stdint.h>

此標頭檔案是型別支援庫的一部分,提供固定寬度整數型別C 數值限制介面的一部分。

目錄

型別

int8_tint16_tint32_tint64_t
(可選)
寬度分別為 8、16、32 和 64 位的有符號整數型別
沒有填充位,對負值使用 2 的補碼
(僅當實現直接支援該型別時才提供)
(typedef) [編輯]
int_fast8_tint_fast16_tint_fast32_tint_fast64_t
寬度至少為 8、16、32 和 64 位的最快有符號整數型別
(typedef) [編輯]
int_least8_tint_least16_tint_least32_tint_least64_t
寬度至少為 8、16、32 和 64 位的最小有符號整數型別
(typedef) [編輯]
intmax_t
最大寬度有符號整數型別
(typedef) [編輯]
intptr_t
(可選)
能夠持有指向 void 指標的有符號整數型別
(typedef) [編輯]
uint8_tuint16_tuint32_tuint64_t
(可選)
寬度分別為 8、16、32 和 64 位的無符號整數型別
(僅當實現直接支援該型別時才提供)
(typedef) [編輯]
uint_fast8_tuint_fast16_tuint_fast32_tuint_fast64_t
寬度至少為 8、16、32 和 64 位的最快無符號整數型別
(typedef) [編輯]
uint_least8_tuint_least16_tuint_least32_tuint_least64_t
寬度至少為 8、16、32 和 64 位的最小無符號整數型別
(typedef) [編輯]
uintmax_t
最大寬度無符號整數型別
(typedef) [編輯]
uintptr_t
(可選)
能夠持有指向 void 指標的無符號整數型別
(typedef) [編輯]

有符號整數:最小值
INT8_MININT16_MININT32_MININT64_MIN
(可選)
分別為 std::int8_tstd::int16_tstd::int32_tstd::int64_t 的最小值
(宏常量) [編輯]
INT_FAST8_MININT_FAST16_MININT_FAST32_MININT_FAST64_MIN
分別為 std::int_fast8_tstd::int_fast16_tstd::int_fast32_tstd::int_fast64_t 的最小值
(宏常量) [編輯]
INT_LEAST8_MININT_LEAST16_MININT_LEAST32_MININT_LEAST64_MIN
分別為 std::int_least8_tstd::int_least16_tstd::int_least32_tstd::int_least64_t 的最小值
(宏常量) [編輯]
INTPTR_MIN
(可選)
std::intptr_t 的最小值
(宏常量) [編輯]
INTMAX_MIN
std::intmax_t 的最小值
(宏常量) [編輯]
有符號整數:最大值
INT8_MAXINT16_MAXINT32_MAXINT64_MAX
(可選)
分別為 std::int8_tstd::int16_tstd::int32_tstd::int64_t 的最大值
(宏常量) [編輯]
INT_FAST8_MAXINT_FAST16_MAXINT_FAST32_MAXINT_FAST64_MAX
分別為 std::int_fast8_tstd::int_fast16_tstd::int_fast32_tstd::int_fast64_t 的最大值
(宏常量) [編輯]
INT_LEAST8_MAXINT_LEAST16_MAXINT_LEAST32_MAXINT_LEAST64_MAX
分別為 std::int_least8_tstd::int_least16_tstd::int_least32_tstd::int_least64_t 的最大值
(宏常量) [編輯]
INTPTR_MAX
(可選)
std::intptr_t 的最大值
(宏常量) [編輯]
INTMAX_MAX
std::intmax_t 的最大值
(宏常量) [編輯]
無符號整數:最大值
UINT8_MAXUINT16_MAXUINT32_MAXUINT64_MAX
(可選)
分別為 std::uint8_tstd::uint16_tstd::uint32_tstd::uint64_t 的最大值
(宏常量) [編輯]
UINT_FAST8_MAXUINT_FAST16_MAXUINT_FAST32_MAXUINT_FAST64_MAX
分別為 std::uint_fast8_tstd::uint_fast16_tstd::uint_fast32_tstd::uint_fast64_t 的最大值
(宏常量) [編輯]
UINT_LEAST8_MAXUINT_LEAST16_MAXUINT_LEAST32_MAXUINT_LEAST64_MAX
分別為 std::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_t 的最大值
(宏常量) [編輯]
UINTPTR_MAX
(可選)
std::uintptr_t 的最大值
(宏常量) [編輯]
UINTMAX_MAX
std::uintmax_t 的最大值
(宏常量) [編輯]
其他整數型別的限制
PTRDIFF_MIN
(C++11)
std::ptrdiff_t 的最小值
(宏常量) [編輯]
PTRDIFF_MAX
(C++11)
std::ptrdiff_t 的最大值
(宏常量) [編輯]
SIZE_MAX
(C++11)
std::size_t 的最大值
(宏常量) [編輯]
SIG_ATOMIC_MIN
(C++11)
std::sig_atomic_t 的最小值
(宏常量) [編輯]
SIG_ATOMIC_MAX
(C++11)
std::sig_atomic_t 的最大值
(宏常量) [編輯]
WCHAR_MIN
(C++11)
wchar_t 的最小值
(宏常量) [編輯]
WCHAR_MAX
(C++11)
wchar_t 的最大值
(宏常量) [編輯]
WINT_MIN
(C++11)
std::wint_t 的最小值
(宏常量) [編輯]
WINT_MAX
(C++11)
std::wint_t 的最大值
(宏常量) [編輯]
整數常量函式宏
INT8_CINT16_CINT32_CINT64_C
展開為整數常量表達式,其值為其引數指定的值,型別分別為 std::int_least8_tstd::int_least16_tstd::int_least32_tstd::int_least64_t提升型別
(函式宏) [編輯]
INTMAX_C
展開為整數常量表達式,其值為其引數指定的值,型別為 std::intmax_t
(函式宏) [編輯]
UINT8_CUINT16_CUINT32_CUINT64_C
展開為整數常量表達式,其值為其引數指定的值,型別分別為 std::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_t提升型別
(函式宏) [編輯]
UINTMAX_C
展開為整數常量表達式,其值為其引數指定的值,型別為 std::uintmax_t
(函式宏) [編輯]

[編輯] 概要

namespace std {
  using int8_t         = /* signed integer type */;   // optional
  using int16_t        = /* signed integer type */;   // optional
  using int32_t        = /* signed integer type */;   // optional
  using int64_t        = /* signed integer type */;   // optional
  using intN_t         = /* see description */;       // optional, see description
 
  using int_fast8_t    = /* signed integer type */;
  using int_fast16_t   = /* signed integer type */;
  using int_fast32_t   = /* signed integer type */;
  using int_fast64_t   = /* signed integer type */;
  using int_fastN_t    = /* see description */;       // optional, see description
 
  using int_least8_t   = /* signed integer type */;
  using int_least16_t  = /* signed integer type */;
  using int_least32_t  = /* signed integer type */;
  using int_least64_t  = /* signed integer type */;
  using int_leastN_t   = /* see description */;       // optional, see description
 
  using intmax_t       = /* signed integer type */;
  using intptr_t       = /* signed integer type */;   // optional
 
  using uint8_t        = /* unsigned integer type */; // optional
  using uint16_t       = /* unsigned integer type */; // optional
  using uint32_t       = /* unsigned integer type */; // optional
  using uint64_t       = /* unsigned integer type */; // optional
  using uintN_t        = /* see description */;       // optional, see description
 
  using uint_fast8_t   = /* unsigned integer type */;
  using uint_fast16_t  = /* unsigned integer type */;
  using uint_fast32_t  = /* unsigned integer type */;
  using uint_fast64_t  = /* unsigned integer type */;
  using uint_fastN_t   = /* see description */;       // optional, see description
 
  using uint_least8_t  = /* unsigned integer type */;
  using uint_least16_t = /* unsigned integer type */;
  using uint_least32_t = /* unsigned integer type */;
  using uint_least64_t = /* unsigned integer type */;
  using uint_leastN_t  = /* see description */;       // optional, see description
 
  using uintmax_t      = /* unsigned integer type */;
  using uintptr_t      = /* unsigned integer type */; // optional
}
 
#define INTN_MIN         /* see description */
#define INTN_MAX         /* see description */
#define UINTN_MAX        /* see description */
 
#define INT_FASTN_MIN    /* see description */
#define INT_FASTN_MAX    /* see description */
#define UINT_FASTN_MAX   /* see description */
 
#define INT_LEASTN_MIN   /* see description */
#define INT_LEASTN_MAX   /* see description */
#define UINT_LEASTN_MAX  /* see description */
 
#define INTMAX_MIN       /* see description */
#define INTMAX_MAX       /* see description */
#define UINTMAX_MAX      /* see description */
 
#define INTPTR_MIN       /* see description */        // optional
#define INTPTR_MAX       /* see description */        // optional
#define UINTPTR_MAX      /* see description */        // optional
 
#define PTRDIFF_MIN      /* see description */
#define PTRDIFF_MAX      /* see description */
#define SIZE_MAX         /* see description */
 
#define SIG_ATOMIC_MIN   /* see description */
#define SIG_ATOMIC_MAX   /* see description */
 
#define WCHAR_MIN        /* see description */
#define WCHAR_MAX        /* see description */
 
#define WINT_MIN         /* see description */
#define WINT_MAX         /* see description */
 
#define INTN_C(value)    /* see description */
#define UINTN_C(value)   /* see description */
#define INTMAX_C(value)  /* see description */
#define UINTMAX_C(value) /* see description */