4.80 Extended integer types and functions in <inttypes.h> and <stdint.h> in C99

In C90, the long data type can serve both as the largest integral type, and as a 32-bit container. C99 removes this ambiguity through the new standard library header files <inttypes.h> and <stdint.h>.

The header file <stdint.h> introduces the new types:
  • intmax_t and uintmax_t, that are maximum width signed and unsigned integer types.
  • intptr_t and unintptr_t, that are integer types capable of holding signed and unsigned object pointers.
The header file <inttypes.h> provides library functions for manipulating values of type intmax_t, including:
intmax_t imaxabs(intmax_t x); // absolute value of x
imaxdiv_t imaxdiv(intmax_t x, intmax_t y) // returns the quotient and remainder
                                          // of x / y
These header files are also available in C90 and C++.
Related concepts
4.63 New library features of C99
4.77 Additional <math.h> library functions in C99
4.78 Complex numbers in C99
4.79 Boolean type and <stdbool.h> in C99
4.81 <fenv.h> floating-point environment access in C99
4.82 <stdio.h> snprintf family of functions in C99
4.83 <tgmath.h> type-generic math macros in C99
4.84 <wchar.h> wide character I/O functions in C99
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.