Standard library header <cstdint>
From cppreference.com
This header was originally in the C standard library as <stdint.h>
.
This header is part of the type support library, providing fixed width integer types and part of C numeric limits interface.
Contents |
[edit] Types
signed integer type with width of exactly 8, 16, 32 and 64 bits respectively with no padding bits and using 2's complement for negative values (provided if and only if the implementation directly supports the type) (typedef) |
|
fastest signed integer type with width of at least 8, 16, 32 and 64 bits respectively (typedef) |
|
smallest signed integer type with width of at least 8, 16, 32 and 64 bits respectively (typedef) |
|
maximum width integer type (typedef) |
|
integer type capable of holding a pointer (typedef) |
|
unsigned integer type with width of exactly 8, 16, 32 and 64 bits respectively (provided if and only if the implementation directly supports the type) (typedef) |
|
fastest unsigned integer type with width of at least 8, 16, 32 and 64 bits respectively (typedef) |
|
smallest unsigned integer type with width of at least 8, 16, 32 and 64 bits respectively (typedef) |
|
maximum width unsigned integer type (typedef) |
|
unsigned integer type capable of holding a pointer (typedef) |
[edit] Macros
Signed integers : minimum value |
|
minimum value of an object of type int8_t, int16_t, int32_t, int64_t (macro constant) |
|
minimum value of an object of type int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t (macro constant) |
|
minimum value of an object of type int_least8_t, int_least16_t, int_least32_t, int_least64_t (macro constant) |
|
minimum value of an object of type intptr_t (macro constant) |
|
minimum value of an object of type intmax_t (macro constant) |
|
Signed integers : maximum value |
|
maximum value of an object of type int8_t, int16_t, int32_t, int64_t (macro constant) |
|
maximum value of an object of type int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t (macro constant) |
|
maximum value of an object of type int_least8_t, int_least16_t, int_least32_t, int_least64_t (macro constant) |
|
maximum value of an object of type intptr_t (macro constant) |
|
maximum value of an object of type intmax_t (macro constant) |
|
Unsigned integers : maximum value |
|
maximum value of an object of type uint8_t, uint16_t, uint32_t, uint64_t (macro constant) |
|
maximum value of an object of type uint_fast8_t, uint_fast16_t, uint_fast32_t, uint_fast64_t (macro constant) |
|
maximum value of an object of type uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t (macro constant) |
|
maximum value of an object of type uintptr_t (macro constant) |
|
maximum value of an object of type uintmax_t (macro constant) |
|
Limits of other integer types |
|
minimum value of object of std::ptrdiff_t type (macro constant) |
|
maximum value of object of std::ptrdiff_t type (macro constant) |
|
maximum value of object of std::size_t type (macro constant) |
|
minimum value of object of std::sig_atomic_t type (macro constant) |
|
maximum value of object of std::sig_atomic_t type (macro constant) |
|
minimum value of object of wchar_t type (macro constant) |
|
maximum value of object of wchar_t type (macro constant) |
|
minimum value of object of std::wint_t type (macro constant) |
|
maximum value of object of std::wint_t type (macro constant) |
|
Function macros for integer constants |
|
expands to an integer constant having the value specified by its argument and the type int_least8_t, int_least16_t, int_least32_t, int_least64_t respectively (function macro) |
|
expands to an integer constant having the value specified by its argument and the type intmax_t (function macro) |
|
expands to an integer constant having the value specified by its argument and the type uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t respectively (function macro) |
|
expands to an integer constant having the value specified by its argument and the type uintmax_t (function macro) |
[edit] Synopsis
namespace std { typedef /*signed integer type*/ int8_t; // optional typedef /*signed integer type*/ int16_t; // optional typedef /*signed integer type*/ int32_t; // optional typedef /*signed integer type*/ int64_t; // optional typedef /*signed integer type*/ int_fast8_t; typedef /*signed integer type*/ int_fast16_t; typedef /*signed integer type*/ int_fast32_t; typedef /*signed integer type*/ int_fast64_t; typedef /*signed integer type*/ int_least8_t; typedef /*signed integer type*/ int_least16_t; typedef /*signed integer type*/ int_least32_t; typedef /*signed integer type*/ int_least64_t; typedef /*signed integer type*/ intmax_t; typedef /*signed integer type*/ intptr_t; //optional typedef /*unsigned integer type*/ uint8_t; // optional typedef /*unsigned integer type*/ uint16_t; // optional typedef /*unsigned integer type*/ uint32_t; // optional typedef /*unsigned integer type*/ uint64_t; // optional typedef /*unsigned integer type*/ uint_fast8_t; typedef /*unsigned integer type*/ uint_fast16_t; typedef /*unsigned integer type*/ uint_fast32_t; typedef /*unsigned integer type*/ uint_fast64_t; typedef /*unsigned integer type*/ uint_least8_t; typedef /*unsigned integer type*/ uint_least16_t; typedef /*unsigned integer type*/ uint_least32_t; typedef /*unsigned integer type*/ uint_least64_t; typedef /*unsigned integer type*/ uintmax_t; typedef /*unsigned integer type*/ uintptr_t; //optional } // namespace std