The
<inttypes.h> header describes a set of format specifier macros aimed to increase portability both within and across operating systems. It includes the
<stdint.h> header and extends it with additional facilities.
Each of the following macros expand to a character string literal containing the format specifier suitable for use within the format argument of a formatted I/O function such as
printf(3). Each macro contains an identifier (PRI or SCN), a conversion specifier, and a possible length modifier.
The length modifier follows the integer types described in
stdint(3):
int_least8_t
uint_least8_t
int_least16_t
uint_least16_t
int_least32_t
uint_least32_t
int_least64_t
uint_least64_t
int_fast16_t
uint_fast16_t
int_fast32_t
uint_fast32_t
int_fast64_t
uint_fast64_t
The following format specifiers are defined for the
fprintf(3) and
fscanf(3) families, respectively:
The available conversion specifiers, “?” in above, are
d and
i for signed integers and
o,
u,
x, and
X for unsigned integers. The
X is not available for the
fscanf(3) family. Without the length modifier these would correspond with
%d,
%i,
%o,
%u,
%x, and
%X, respectively.