|
|
The C99 header <stdint.h> does not declare any functions, but it does define a large number of integer types and macros. The integer types are used to declare integers of known sizes or that manifest a specified trait.
Macros of the form intN_t specify an integer with N bits. For example, int16_t specifies a 16-bit signed integer. Macros of the form uintN_t specify an unsigned integer with N bits. For example, uint32_t specifies a 32-bit unsigned integer. Macros with the values 8, 16, 32, and 64 for N will be available in all environments that offer integers in these widths.
Macros of the form int_leastN_t specify an integer with at least N bits. Macros of the form uint_leastN_t specify an unsigned integer with at least N bits. Macros with the values 8, 16, 32, and 64 for N will be available in all environments. For example, int_least16_t is a valid type.
Macros of the form int_fastN_t specify the fastest integer type that has at least N bits. Macros of the form uint_fastN_t specify the fastest unsigned integer type that has at least N bits. Macros with the values 8, 16, 32, and 64 for N will be available in all environments. For example, int_fast32_t is valid in all settings.
The type intmax_t specifies a maximum-sized signed integer and the type uintmax_t specifies a maximum-sized unsigned integer.
Also defined are the intptr_t and uintptr_t types. These can be used to create integers that can hold pointers. These types are optional.
<stdint.h> defines several function-like macros that expand into constants of a specified integer type. These macros have the following general forms:
INTN_C(value)
UINTN_C(value)
where N is the bit width of the desired type. Each macro creates a constant that has at least N bits that contains the specified value.
Also defined are the following macros:
INTMAX_C(value)
UINTMAX_C(value)
These create maximum-width constants of the specified value.
|
|