NAME
inttypes — fixed-size integer data types
DESCRIPTION
This header file defines integer data types of various sizes.
By using the data types defined in this header file, developers can be assured that the data types will have the same properties and behavior on different systems.
Since not all implementations are required to support all of the
integer sizes defined in this manual page, the proper way to see
if a particular size of an integer is supported on the current
implementation is to test the symbol that defines its maximum value.
For example, if
#ifdef UINT64_MAX
tests false, then that implementation does not support 64-bit
unsigned signed integers.
The
<inttypes.h>
header includes
<stdint.h>
header.
This header file defines the following data type.
- imaxdiv_t
structure type that is the type of the value returned by the
imaxdiv()
function
The following macros can be used as formatting options with the
printf()
family of functions (see
printf(3S)).
These macros are used to select the correct formatting option for
the integer data types defined earlier in this manual page.
PRId8 d print formatting option for int8_t
PRId16 d print formatting option for int16_t
PRId32 d print formatting option for int32_t
PRId64 d print formatting option for int64_t
PRIdMAX d print formatting option for intmax_t
PRIdFAST8 d print formatting option for int_fast8_t
PRIdFAST16 d print formatting option for int_fast16_t
PRIdFAST32 d print formatting option for int_fast32_t
PRIdFAST64 d print formatting option for int_fast64_t
PRIdFAST d print formatting option for intfast_t
PRIdLEAST8 d print formatting option for int_least8_t
PRIdLEAST16 d print formatting option for int_least16_t
PRIdLEAST32 d print formatting option for int_least32_t
PRIdLEAST64 d print formatting option for int_least64_t
PRIi8 i print formatting option for int8_t
PRIi16 i print formatting option for int16_t
PRIi32 i print formatting option for int32_t
PRIi64 i print formatting option for int64_t
PRIiFAST8 i print formatting option for int_fast8_t
PRIiFAST16 i print formatting option for int_fast16_t
PRIiFAST32 i print formatting option for int_fast32_t
PRIiFAST64 i print formatting option for int_fast64_t
PRIiLEAST8 i print formatting option for int_least8_t
PRIiLEAST16 i print formatting option for int_least16_t
PRIiLEAST32 i print formatting option for int_least32_t
PRIiLEAST64 i print formatting option for int_least64_t
PRIu8 u print formatting option for uint8_t
PRIu16 u print formatting option for uint16_t
PRIu32 u print formatting option for uint32_t
PRIu64 u print formatting option for uint64_t
PRIuMAX u print formatting option for uintmax_t
PRIuFAST8 u print formatting option for uint_fast8_t
PRIuFAST16 u print formatting option for uint_fast16_t
PRIuFAST32 u print formatting option for uint_fast32_t
PRIuFAST64 u print formatting option for uint_fast64_t
PRIuFAST u print formatting option for uintfast_t
PRIuLEAST8 u print formatting option for uint_least8_t
PRIuLEAST16 u print formatting option for uint_least16_t
PRIuLEAST32 u print formatting option for uint_least32_t
PRIuLEAST64 u print formatting option for uint_least64_t
PRIo8 o print formatting option for int8_t
PRIo16 o print formatting option for int16_t
PRIo32 o print formatting option for int32_t
PRIo64 o print formatting option for int64_t
PRIoMAX o print formatting option for intmax_t
PRIoFAST8 o print formatting option for int_fast8_t
PRIoFAST16 o print formatting option for int_fast16_t
PRIoFAST32 o print formatting option for int_fast32_t
PRIoFAST64 o print formatting option for int_fast64_t
PRIoFAST o print formatting option for intfast_t
PRIoLEAST8 o print formatting option for int_least8_t
PRIoLEAST16 o print formatting option for int_least16_t
PRIoLEAST32 o print formatting option for int_least32_t
PRIoLEAST64 o print formatting option for int_least64_t
PRIx8 x print formatting option for int8_t
PRIx16 x print formatting option for int16_t
PRIx32 x print formatting option for int32_t
PRIx64 x print formatting option for int64_t
PRIxMAX x print formatting option for intmax_t
PRIxFAST8 x print formatting option for int_fast8_t
PRIxFAST16 x print formatting option for int_fast16_t
PRIxFAST32 x print formatting option for int_fast32_t
PRIxFAST64 x print formatting option for int_fast64_t
PRIoFAST x print formatting option for intfast_t
PRIxLEAST8 x print formatting option for int_least8_t
PRIxLEAST16 x print formatting option for int_least16_t
PRIxLEAST32 x print formatting option for int_least32_t
PRIxLEAST64 x print formatting option for int_least64_t
PRIX8 X print formatting option for int8_t
PRIX16 X print formatting option for int16_t
PRIX32 X print formatting option for int32_t
PRIX64 X print formatting option for int64_t
PRIXFAST8 X print formatting option for int_fast8_t
PRIXFAST16 X print formatting option for int_fast16_t
PRIXFAST32 X print formatting option for int_fast32_t
PRIXFAST64 X print formatting option for int_fast64_t
PRIXLEAST8 X print formatting option for int_least8_t
PRIXLEAST16 X print formatting option for int_least16_t
PRIXLEAST32 X print formatting option for int_least32_t
PRIXLEAST64 X print formatting option for int_least64_t
The following macros can be used as formatting options with the
scanf()
family of functions (see
scanf(3S)).
These macros are used to select the correct formatting option for
the integer data types defined earlier in this manual page.
SCNd16 d scan formatting option for int16_t
SCNd32 d scan formatting option for int32_t
SCNd64 d scan formatting option for int64_t
SCNdMAX d scan formatting option for intmax_t
SCNi16 i scan formatting option for int16_t
SCNi32 i scan formatting option for int32_t
SCNi64 i scan formatting option for int64_t
SCNiMAX i scan formatting option for intmax_t
SCNu16 u scan formatting option for uint16_t
SCNu32 u scan formatting option for uint32_t
SCNu64 u scan formatting option for uint64_t
SCNo16 o scan formatting option for int16_t
SCNo32 o scan formatting option for int32_t
SCNo64 o scan formatting option for int64_t
SCNoMAX o scan formatting option for intmax_t
SCNx16 x scan formatting option for int16_t
SCNx32 x scan formatting option for int32_t
SCNx64 x scan formatting option for int64_t
SCNxMAX x scan formatting option for intmax_t
SCNdFAST d scan formatting option for intfast_t
SCNiFAST i scan formatting option for intfast_t
SCNoFAST o scan formatting option for intfast_t
SCNxFAST x scan formatting option for intfast_t
Notes
The formatting options for the
printf()
family of functions all begin with
PRI,
whereas the formatting options for the
scanf()
family of functions all begin with
SCN.
These formatting strings may not be interchangeable.
EXAMPLES
The following example shows how to use one of the print formatting
options with the
printf()
function.
uint64_t u;
...
printf("u = %016" PRIx64 "\n", u);
AUTHOR
inttypes.h
was developed by HP.
FILES
/usr/include/inttypes.h