This header was originally in the C standard library as
.
This header is part of the
library, providing
and part of
.
Types
int8_tint16_tint32_tint64_tintN_t
(optional)(optional)(optional)(optional)(optional)
signed integer type with width of exactly N (typically 8, 16, 32 or 64) bits and no padding bits
(typedef)
int_fast8_tint_fast16_tint_fast32_tint_fast64_tint_fastN_t
(optional)
fastest signed integer type with width of at least N (typically 8, 16, 32 or 64) bits
(typedef)
int_least8_tint_least16_tint_least32_tint_least64_tint_leastN_t
(optional)
smallest signed integer type with width of at least N (typically 8, 16, 32 or 64) bits
(if std::intN_t is defined, std::int_leastN_t designates the same type)
(typedef)
intmax_t
maximum-width signed integer type
(typedef)
intptr_t
(optional until c++29)
signed integer type capable of holding a pointer to void
(typedef)
uint8_tuint16_tuint32_tuint64_tuintN_t
(optional)(optional)(optional)(optional)(optional)
unsigned integer type with width of exactly N (typically 8, 16, 32 or 64) bits and no padding bits
(typedef)
uint_fast8_tuint_fast16_tuint_fast32_tuint_fast64_tuint_fastN_t
(optional)
fastest unsigned integer type with width of at least N (typically 8, 16, 32 or 64) bits
(typedef)
uint_least8_tuint_least16_tuint_least32_tuint_least64_tuint_leastN_t
(optional)
smallest unsigned integer type with width of at least N (typically 8, 16, 32 or 64) bits
(if std::uintN_t is defined, std::uint_leastN_t designates the same type)
(typedef)
uintmax_t
maximum-width unsigned integer type
(typedef)
uintptr_t
(optional until c++29)
unsigned integer type capable of holding a pointer to void
(typedef)
Macros
Signed integers : bit width INTN_WIDTH
(C++26)(conditionally present)
bit width of std::intN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INT_FASTN_WIDTH
(C++26)(conditionally present)
bit width of std::int_fastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INT_LEASTN_WIDTH
(C++26)(conditionally present)
bit width of std::int_leastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INTMAX_WIDTH
(C++26)
bit width of std::intmax_t
(macro constant)
INTPTR_WIDTH
(C++26)(conditionally present)
bit width of std::intptr_t
(macro constant)
Signed integers : minimum value INTN_MIN
(conditionally present)
minimum value of std::intN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INT_FASTN_MIN
(conditionally present)
minimum value of std::int_fastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INT_LEASTN_MIN
(conditionally present)
minimum value of std::int_leastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INTMAX_MIN
minimum value of std::intmax_t
(macro constant)
INTPTR_MIN
(conditionally present)
minimum value of std::intptr_t
(macro constant)
Signed integers : maximum value INTN_MAX
(conditionally present)
maximum value of std::intN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INT_FASTN_MAX
(conditionally present)
maximum value of std::int_fastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INT_LEASTN_MAX
(conditionally present)
maximum value of std::int_leastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
INTMAX_MAX
maximum value of std::intmax_t
(macro constant)
INTPTR_MAX
(conditionally present)
maximum value of std::intptr_t
(macro constant)
Unsigned integers : bit width UINTN_WIDTH
(C++26)(conditionally present)
bit width of std::uintN_t (N is typically 8, 16, 32 or 64)
(macro constant)
UINT_FASTN_WIDTH
(C++26)(conditionally present)
bit width of std::uint_fastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
UINT_LEASTN_WIDTH
(C++26)(conditionally present)
bit width of std::uint_leastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
UINTMAX_WIDTH
(C++26)
bit width of std::uintmax_t
(macro constant)
UINTPTR_WIDTH
(C++26)(conditionally present)
bit width of std::uintptr_t
(macro constant)
Unsigned integers : maximum value UINTN_MAX
(conditionally present)
maximum value of std::uintN_t (N is typically 8, 16, 32 or 64)
(macro constant)
UINT_FASTN_MAX
(conditionally present)
maximum value of std::uint_fastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
UINT_LEASTN_MAX
(conditionally present)
maximum value of std::uint_leastN_t (N is typically 8, 16, 32 or 64)
(macro constant)
UINTMAX_MAX
maximum value of std::uintmax_t
(macro constant)
UINTPTR_MAX
(conditionally present)
maximum value of std::uintptr_t
(macro constant)
Characteristics of other integer types PTRDIFF_WIDTH
(C++26)
bit width of
(macro constant)
PTRDIFF_MIN
minimum value of
(macro constant)
PTRDIFF_MAX
maximum value of
(macro constant)
SIZE_WIDTH
(C++26)
bit width of
(macro constant)
SIZE_MAX
maximum value of
(macro constant)
SIG_ATOMIC_WIDTH
(C++26)
bit width of
(macro constant)
SIG_ATOMIC_MIN
minimum value of
(macro constant)
SIG_ATOMIC_MAX
maximum value of
(macro constant)
WINT_WIDTH
(C++26)
bit width of
(macro constant)
WINT_MIN
minimum value of
(macro constant)
WINT_MAX
maximum value of
(macro constant)
WCHAR_WIDTH
(C++26)
bit width of wchar_t
(macro constant)
WCHAR_MIN
minimum value of wchar_t
(macro constant)
WCHAR_MAX
maximum value of wchar_t
(macro constant)
Function macros for integer constants INTN_C
(conditionally present)
expands to an integer constant expression of type std::int_leastN_t, its value is specified by the argument
(function macro)
INTMAX_C
expands to an integer constant expression of type std::intmax_t, its value is specified by the argument
(function macro)
UINTN_C
(conditionally present)
expands to an integer constant expression of type std::uint_leastN_t, its value is specified by the argument
(function macro)
UINTMAX_C
expands to an integer constant expression of type std::uintmax_t, its value is specified by the argument
(function macro)
Note
For each of the typedef names listed above marked (optional), an implementation defines it if and only if the implementation provides a corresponding type.
For each of the macros marked listed above (conditionally present), an implementation defines it if and only if the implementation defines the corresponding typedef name.
Synopsis
// all freestanding#define __STDC_VERSION_STDINT_H__ 202311Lnamespacestd{usingint8_t=/* implementation-defined */;// optionalusingint16_t=/* implementation-defined */;// optionalusingint32_t=/* implementation-defined */;// optionalusingint64_t=/* implementation-defined */;// optionalusingint/*N*/_t=/* see description */;// optionalusingint_fast8_t=/* implementation-defined */;usingint_fast16_t=/* implementation-defined */;usingint_fast32_t=/* implementation-defined */;usingint_fast64_t=/* implementation-defined */;usingint_fast/*N*/_t=/* see description */;// optionalusingint_least8_t=/* implementation-defined */;usingint_least16_t=/* implementation-defined */;usingint_least32_t=/* implementation-defined */;usingint_least64_t=/* implementation-defined */;usingint_least/*N*/_t=/* see description */;// optionalusingintmax_t=/* implementation-defined */;usingintptr_t=/* implementation-defined */;// optionalusinguint8_t=/* implementation-defined */;// optionalusinguint16_t=/* implementation-defined */;// optionalusinguint32_t=/* implementation-defined */;// optionalusinguint64_t=/* implementation-defined */;// optionalusinguint/*N*/_t=/* see description */;// optionalusinguint_fast8_t=/* implementation-defined */;usinguint_fast16_t=/* implementation-defined */;usinguint_fast32_t=/* implementation-defined */;usinguint_fast64_t=/* implementation-defined */;usinguint_fast/*N*/_t=/* see description */;// optionalusinguint_least8_t=/* implementation-defined */;usinguint_least16_t=/* implementation-defined */;usinguint_least32_t=/* implementation-defined */;usinguint_least64_t=/* implementation-defined */;usinguint_least/*N*/_t=/* see description */;// optionalusinguintmax_t=/* implementation-defined */;usinguintptr_t=/* implementation-defined */;// optional}#define INT/*N*/_MIN /* see description */#define INT/*N*/_MAX /* see description */#define UINT/*N*/_MAX /* see description */#define INT/*N*/_WIDTH /* see description */#define UINT/*N*/_WIDTH /* see description */#define INT_FAST/*N*/_MIN /* see description */#define INT_FAST/*N*/_MAX /* see description */#define UINT_FAST/*N*/_MAX /* see description */#define INT_FAST/*N*/_WIDTH /* see description */#define UINT_FAST/*N*/_WIDTH /* see description */#define INT_LEAST/*N*/_MIN /* see description */#define INT_LEAST/*N*/_MAX /* see description */#define UINT_LEAST/*N*/_MAX /* see description */#define INT_LEAST/*N*/_WIDTH /* see description */#define UINT_LEAST/*N*/_WIDTH /* see description */#define INTMAX_MIN /* see description */#define INTMAX_MAX /* see description */#define UINTMAX_MAX /* see description */#define INTMAX_WIDTH /* see description */#define UINTMAX_WIDTH /* see description */#define INTPTR_MIN /* see description */// optional#define INTPTR_MAX /* see description */// optional#define UINTPTR_MAX /* see description */// optional#define INTPTR_WIDTH /* see description */// optional#define UINTPTR_WIDTH /* see description */// optional#define PTRDIFF_MIN /* see description */#define PTRDIFF_MAX /* see description */#define PTRDIFF_WIDTH /* see description */#define SIZE_MAX /* see description */#define SIZE_WIDTH /* see description */#define SIG_ATOMIC_MIN /* see description */#define SIG_ATOMIC_MAX /* see description */#define SIG_ATOMIC_WIDTH /* see description */#define WCHAR_MIN /* see description */#define WCHAR_MAX /* see description */#define WCHAR_WIDTH /* see description */#define WINT_MIN /* see description */#define WINT_MAX /* see description */#define WINT_WIDTH /* see description */#define INT/*N*/_C(value) /* see description */#define UINT/*N*/_C(value) /* see description */#define INTMAX_C(value) /* see description */#define UINTMAX_C(value) /* see description */