Headers inttypes.h(3HEAD)
NAME
inttypes.h, inttypes - fixed size integer types
SYNOPSIS
#include
DESCRIPTION
The
header includes the header. The
ing type:header includes a definition of the follow- imaxdiv_t structure type that is the type of the value
returned by the imaxdiv() function.The following macros are defined. Each expands to a charac-
ter string literal containing a conversion specifier, possi-
bly modified by a length modifier, suitable for use within the format argument of a formatted input/output function when converting the corresponding integer type. These macros have the general form of PRI (character string literals for the fprintf() and fwprintf() family of functions) or SCN (character string literals for the fscanf() and fwscanf() family of functions), followed by the conversion specifier, followed by a name corresponding to a similar type name in. In these names, N represents the width of the type as described in . For example, PRIdFAST32 can be used in a format string to print the value of an integer of type int_fast32_t.
The fprintf() macros for signed integers are: PRIdN PRIdLEASTN PRIdFASTN PRIdMAX PRIdPTR PRIiN PRIiLEASTN PRIiFASTN PRIiMAX PRIiPTR The fprintf() macros for unsigned integers are: PRIoN PRIoLEASTN PRIoFASTN PRIoMAX PRIoPTR PRIuN PRIuLEASTN PRIuFASTN PRIuMAX PRIuPTR PRIxN PRIxLEASTN PRIxFASTN PRIxMAX PRIxPTR PRIXN PRIXLEASTN PRIXFASTN PRIXMAX PRIXPTRSunOS 5.11 Last change: 10 Sep 2004 1
Headers inttypes.h(3HEAD)
The fscanf() macros for signed integers are: SCNdN SCNdLEASTN SCNdFASTN SCNdMAX SCNdPTR SCNiN SCNiLEASTN SCNiFASTN SCNiMAX SCNiPTR The fscanf() macros for unsigned integers are: SCNoN SCNoLEASTN SCNoFASTN SCNoMAX SCNoPTR SCNuN SCNuLEASTN SCNuFASTN SCNuMAX SCNuPTR SCNxN SCNxLEASTN SCNxFASTN SCNxMAX SCNxPTR For each type that the implementation provides inros must be defined. The corresponding fscanf() and
, the corresponding fprintf() and fwprintf() mac- fwscanf() macros must be defined as well, unless the imple-
mentation does not have a suitable modifier for the type.USAGE
The purpose of
types whose definitions are consistent across machines and independent of operating systems and other implementation idiosyncrasies. It defines, with a typedef, integer types of various sizes. Implementations are free to typedef them asis to provide a set of integer ISO C standard integer types or extensions that they sup-
port. Consistent use of this header greatly increases the portability of applications across platforms.EXAMPLES
Example 1 Use of Macro The following code uses one of the macros available through
. #include
#include
int main(void) {uintmax_t i = UINTMAX_MAX; // This type always exists.
wprintf("The largest integer value is %020"
PRIxMAX, "\n", i); return 0; }ATTRIBUTES
SunOS 5.11 Last change: 10 Sep 2004 2
Headers inttypes.h(3HEAD)
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
| Standard | See standards(5). ||_____________________________|_____________________________|
SEE ALSO
imaxdiv(3C), attributes(5), standards(5)SunOS 5.11 Last change: 10 Sep 2004 3