|
|
|
7.8 Format conversion of integer types <inttypes.h> 1 The header <inttypes.h> includes the header <stdint.h> and extends it with additional facilities provided by hosted implementations. 2 It declares functions for manipulating greatest-width integers and converting numeric imaxdiv_t which is a structure type that is the type of the value returned by the imaxdiv function. For each type declared in <stdint.h> , it defines corresponding macros for conversion specifiers for use with the formatted input/output functions. 190) Forward references: integer types <stdint.h> (7.18), formatted input/output functions (7.19.6), formatted wide character input/output functions (7.24.2). 7.8.1 Macros for format specifiers 1 Each of the following object-like macros 191) expands to a character string literal containing a conversion specifier, possibly modified by a length modifier, suitable for use PRI (character string literals for the fprintf and fwprintf family) or SCN (character string literals for the fscanf and fwscanf family), 192) followed by the conversion specifier, followed by a name corresponding to a similar type name in 7.18.1. In these names, N PRIdFAST32 can be used in a format string to print the value of an integer of type int_fast32_t . 2 The fprintf macros for signed integers are: PRId N PRIdLEAST N PRIdFAST N PRIdMAX PRIdPTR PRIi N PRIiLEAST N PRIiFAST N PRIiMAX PRIiPTR 190) See ‘‘future library directions’’ (7.26.4). 191) C++ implementations should define these macros only when _ _STDC_FORMAT_MACROS is defined before <inttypes.h> is included. 192) Separate macros are given for use with fprintf and fscanf functions because, in the general case, different format specifiers may be required for fprintf and fscanf , even when the type is the same. 198 Library §7.8.1 |