`<stdint.h>`

[added with C99]

```
int8_t
· int16_t
· int32_t
· int64_t
· int_fast8_t
· int_fast16_t
· int_fast32_t
· int_fast64_t
· int_least8_t
· int_least16_t
· int_least32_t
· int_least64_t
```

```
uint8_t
· uint16_t
· uint32_t
· uint64_t
· uint_fast8_t
· uint_fast16_t
· uint_fast32_t
· uint_fast64_t
· uint_least8_t
· uint_least16_t
· uint_least32_t
· uint_least64_t
```

```
intmax_t
· intptr_t
· uintmax_t
· uintptr_t
```

```
INT8_C
· INT16_C
· INT32_C
· INT64_C
· INT8_MAX
· INT16_MAX
· INT32_MAX
· INT64_MAX
· INT8_MIN
· INT16_MIN
· INT32_MIN
· INT64_MIN
· INT_FAST8_MAX
· INT_FAST16_MAX
· INT_FAST32_MAX
· INT_FAST64_MAX
· INT_FAST8_MIN
· INT_FAST16_MIN
· INT_FAST32_MIN
· INT_FAST64_MIN
· INT_LEAST8_MAX
· INT_LEAST16_MAX
· INT_LEAST32_MAX
· INT_LEAST64_MAX
· INT_LEAST8_MIN
· INT_LEAST16_MIN
· INT_LEAST32_MIN
· INT_LEAST64_MIN
```

```
UINT8_C
· UINT16_C
· UINT32_C
· UINT64_C
· UINTMAX_C
· UINT8_MAX
· UINT16_MAX
· UINT32_MAX
· UINT64_MAX
· UINT_FAST8_MAX
· UINT_FAST16_MAX
· UINT_FAST32_MAX
· UINT_FAST64_MAX
· UINT_LEAST8_MAX
· UINT_LEAST16_MAX
· UINT_LEAST32_MAX
· UINT_LEAST64_MAX
```

```
INTMAX_C
· INTMAX_MAX
· INTMAX_MIN
· INTPTR_MAX
· INTPTR_MIN
· PTRDIFF_MAX
· PTRDIFF_MIN
· SIG_ATOMIC_MAX
· SIG_ATOMIC_MIN
· SIZE_MAX
· WCHAR_MAX
· WCHAR_MIN
· WINT_MAX
· WINT_MIN
· UINTMAX_MAX
· UINTPTR_MAX
```

Include the standard header ** <stdint.h>**
to define various integer types, and related macros, with size
constraints. Note that the definitions shown for the types and
macros are merely representative -- they can vary among implementations.

/* TYPE DEFINITIONS */ typedef signed charint8_t; typedef shortint16_t; typedef longint32_t; typedef long longint64_t; typedef unsigned charuint8_t; typedef unsigned shortuint16_t; typedef unsigned longuint32_t; typedef unsigned long longuint64_t; typedef signed charint_least8_t; typedef shortint_least16_t; typedef longint_least32_t; typedef long longint_least64_t; typedef unsigned charuint_least8_t; typedef unsigned shortuint_least16_t; typedef unsigned longuint_least32_t; typedef unsigned long longuint_least64_t; typedef signed charint_fast8_t; typedef shortint_fast16_t; typedef longint_fast32_t; typedef long longint_fast64_t; typedef unsigned charuint_fast8_t; typedef unsigned shortuint_fast16_t; typedef unsigned longuint_fast32_t; typedef unsigned long longuint_fast64_t; typedef longintptr_t; typedef unsigned longuintptr_t; typedef long longintmax_t; typedef unsigned long longuintmax_t; /* LIMIT MACROS */ #defineINT8_MIN(-0x7f - 1) #defineINT16_MIN(-0x7fff - 1) #defineINT32_MIN(-0x7fffffff - 1) #defineINT64_MIN(-0x7fffffffffffffff - 1) #defineINT8_MAX0x7f[exact]#defineINT16_MAX0x7fff[exact]#defineINT32_MAX0x7fffffff[exact]#defineINT64_MAX0x7fffffffffffffff[exact]#defineUINT8_MAX0xff[exact]#defineUINT16_MAX0xffff[exact]#defineUINT32_MAX0xffffffff[exact]#defineUINT64_MAX0xffffffffffffffff[exact]#defineINT_LEAST8_MIN(-0x7f - 1) #defineINT_LEAST16_MIN(-0x7fff - 1) #defineINT_LEAST32_MIN(-0x7fffffff - 1) #defineINT_LEAST64_MIN(-0x7fffffffffffffff - 1) #defineINT_LEAST8_MAX0x7f #defineINT_LEAST16_MAX0x7fff #defineINT_LEAST32_MAX0x7fffffff #defineINT_LEAST64_MAX0x7fffffffffffffff #defineUINT_LEAST8_MAX0xff #defineUINT_LEAST16_MAX0xffff #defineUINT_LEAST32_MAX0xffffffff #defineUINT_LEAST64_MAX0xffffffffffffffff #defineINT_FAST8_MIN(-0x7f - 1) #defineINT_FAST16_MIN(-0x7fff - 1) #defineINT_FAST32_MIN(-0x7fffffff - 1) #defineINT_FAST64_MIN(-0x7fffffffffffffff - 1) #defineINT_FAST8_MAX0x7f #defineINT_FAST16_MAX0x7fff #defineINT_FAST32_MAX0x7fffffff #defineINT_FAST64_MAX0x7fffffffffffffff #defineUINT_FAST8_MAX0xff #defineUINT_FAST16_MAX0xffff #defineUINT_FAST32_MAX0xffffffff #defineUINT_FAST64_MAX0xffffffffffffffff #defineINTPTR_MIN(-0x7fffffff - 1) #defineINTPTR_MAX0x7fffffff #defineUINTPTR_MAX0xffffffff #defineINT8_C(x) (x) #defineINT16_C(x) (x) #defineINT32_C(x) ((x) + (INT32_MAX - INT32_MAX)) #defineINT64_C(x) ((x) + (INT64_MAX - INT64_MAX)) #defineUINT8_C(x) (x) #defineUINT16_C(x) (x) #defineUINT32_C(x) ((x) + (UINT32_MAX - UINT32_MAX)) #defineUINT64_C(x) ((x) + (UINT64_MAX - UINT64_MAX)) #defineINTMAX_C(x) ((x) + (INT64_MAX - INT64_MAX)) #defineUINTMAX_C(x) ((x) + (UINT64_MAX - UINT64_MAX)) #definePTRDIFF_MININT32_MIN #definePTRDIFF_MAXINT32_MAX #defineSIG_ATOMIC_MININT32_MIN #defineSIG_ATOMIC_MAXINT32_MAX #defineSIZE_MAXUINT32_MAX #defineWCHAR_MIN0 #defineWCHAR_MAXUINT16_MAX #defineWINT_MIN0 #defineWINT_MAXUINT16_MAX #defineINTMAX_MIN(-0x7fffffffffffffff - 1) #defineINTMAX_MAX0x7fffffffffffffff #defineUINTMAX_MAX0xffffffffffffffff

`INT8_C`

,
`INT16_C`

,
`INT32_C`

,
`INT64_C`

#defineINT8_C(x) (x) #defineINT16_C(x) (x) #defineINT32_C(x) ((x) + (INT32_MAX - INT32_MAX)) #defineINT64_C(x) ((x) + (INT64_MAX - INT64_MAX))

The macros each convert an integer literal to a signed integer type whose representation has at least eight, 16, 32, or 64 bits, respectively. Note that the definitions shown here are merely representative.

`INT8_MAX`

,
`INT16_MAX`

,
`INT32_MAX`

,
`INT64_MAX`

#defineINT8_MAX0x7f[exact]#defineINT16_MAX0x7fff[exact]#defineINT32_MAX0x7fffffff[exact]#defineINT64_MAX0x7fffffffffffffff[exact]

The macros each expand to an
*#if* expression
that yields the maximum value representable as type
`int8_t`

,
`int16_t`

,
`int32_t`

, or
`int64_t`

, respectively.
Note that the definitions shown here are *exact.*

`INT8_MIN`

,
`INT16_MIN`

,
`INT32_MIN`

,
`INT64_MIN`

#defineINT8_MIN(-0x7f - 1) #defineINT16_MIN(-0x7fff - 1) #defineINT32_MIN(-0x7fffffff - 1) #defineINT64_MIN(-0x7fffffffffffffff - 1)

The macros each expand to an
*#if* expression
that yields the minimum value representable as type
`int8_t`

,
`int16_t`

,
`int32_t`

, or
`int64_t`

, respectively.
Note that the definitions shown here are merely representative.

`int8_t`

,
`int16_t`

,
`int32_t`

,
`int64_t`

typedef signed charint8_t; typedef shortint16_t; typedef longint32_t; typedef long longint64_t;

The types each specify a signed integer type whose representation has exactly eight, 16, 32, or 64 bits, respectively. Note that the definitions shown here are merely representative.

`INT_FAST8_MAX`

,
`INT_FAST16_MAX`

,
`INT_FAST32_MAX`

,
`INT_FAST64_MAX`

#defineINT_FAST8_MAX0x7f #defineINT_FAST16_MAX0x7fff #defineINT_FAST32_MAX0x7fffffff #defineINT_FAST64_MAX0x7fffffffffffffff

The macros each expand to an
*#if* expression
that yields the maximum value representable as type
`int_fast8_t`

,
`int_fast16_t`

,
`int_fast32_t`

, or
`int_fast64_t`

, respectively.
Note that the definitions shown here are merely representative.

`INT_FAST8_MIN`

,
`INT_FAST16_MIN`

,
`INT_FAST32_MIN`

,
`INT_FAST64_MIN`

#defineINT_FAST8_MIN(-0x7f - 1) #defineINT_FAST16_MIN(-0x7fff - 1) #defineINT_FAST32_MIN(-0x7fffffff - 1) #defineINT_FAST64_MIN(-0x7fffffffffffffff - 1)

The macros each expand to an
*#if* expression
that yields the minimum value representable as type
`int_fast8_t`

,
`int_fast16_t`

,
`int_fast32_t`

, or
`int_fast64_t`

, respectively.
Note that the definitions shown here are merely representative.

`int_fast8_t`

,
`int_fast16_t`

,
`int_fast32_t`

,
`int_fast64_t`

typedef signed charint_fast8_t; typedef shortint_fast16_t; typedef longint_fast32_t; typedef long longint_fast64_t;

The types each specify a signed integer type that supports the fastest operations among those whose representation has at least eight, 16, 32, or 64 bits, respectively. Note that the definitions shown here are merely representative.

`INT_LEAST8_MAX`

,
`INT_LEAST16_MAX`

,
`INT_LEAST32_MAX`

,
`INT_LEAST64_MAX`

#defineINT_LEAST8_MAX0x7f #defineINT_LEAST16_MAX0x7fff #defineINT_LEAST32_MAX0x7fffffff #defineINT_LEAST64_MAX0x7fffffffffffffff

The macros each expand to an
*#if* expression
that yields the maximum value representable as type
`int_least8_t`

,
`int_least16_t`

,
`int_least32_t`

, or
`int_least64_t`

, respectively.
Note that the definitions shown here are merely representative.

`INT_LEAST8_MIN`

,
`INT_LEAST16_MIN`

,
`INT_LEAST32_MIN`

,
`INT_LEAST64_MIN`

#defineINT_LEAST8_MIN(-0x7f - 1) #defineINT_LEAST16_MIN(-0x7fff - 1) #defineINT_LEAST32_MIN(-0x7fffffff - 1) #defineINT_LEAST64_MIN(-0x7fffffffffffffff - 1)

The macros each expand to an
*#if* expression
that yields the minimum value representable as type
`int_least8_t`

,
`int_least16_t`

,
`int_least32_t`

, or
`int_least64_t`

, respectively.
Note that the definitions shown here are merely representative.

`int_least8_t`

,
`int_least16_t`

,
`int_least32_t`

,
`int_least64_t`

typedef signed charint_least8_t; typedef shortint_least16_t; typedef longint_least32_t; typedef long longint_least64_t;

The types each specify a signed integer type whose representation has at least eight, 16, 32, or 64 bits, respectively. Note that the definitions shown here are merely representative.

`INTMAX_C`

#defineINTMAX_C(x) ((x) + (INT64_MAX - INT64_MAX))

The macro converts an integer literal to the largest signed integer type. Note that the definition shown here is merely representative.

`INTMAX_MAX`

#defineINTMAX_MAX0x7fffffffffffffff

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`intmax_t`

.
Note that the definition shown here is merely representative.

`INTMAX_MIN`

#defineINTMAX_MIN(-0x7fffffffffffffff - 1)

The macro expands to an
*#if* expression
that yields the minimum value representable as type
`intmax_t`

.
Note that the definition shown here is merely representative.

`intmax_t`

typedef long longintmax_t;

The type specifies the largest signed integer type. Note that the definition shown here is merely representative.

`INTPTR_MAX`

#defineINTPTR_MAX0x7fffffff

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`intptr_t`

.
Note that the definition shown here is merely representative.

`INTPTR_MIN`

#defineINTPTR_MIN(-0x7fffffff - 1)

The macro expands to an
*#if* expression
that yields the minimum value representable as type
`intptr_t`

.
Note that the definition shown here is merely representative.

`intptr_t`

typedef longintptr_t;

The type specifies a signed integer type large enough to support
interconversion with a void pointer. (You can convert a void pointer to
`intptr_t`

and back, and the result compares equal to the original
pointer value.)
Note that the definition shown here is merely representative.

`PTRDIFF_MAX`

#definePTRDIFF_MAXINT32_MAX

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`ptrdiff_t`

.
Note that the definition shown here is merely representative.

`PTRDIFF_MIN`

#definePTRDIFF_MININT32_MIN

The macro expands to an
*#if* expression
that yields the minimum value representable as type
`ptrdiff_t`

.
Note that the definition shown here is merely representative.

`SIG_ATOMIC_MAX`

#defineSIG_ATOMIC_MAXINT32_MAX

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`sig_atomic_t`

.
Note that the definition shown here is merely representative.

`SIG_ATOMIC_MIN`

#defineSIG_ATOMIC_MININT32_MIN

The macro expands to an
*#if* expression
that yields the minimum value representable as type
`sig_atomic_t`

.
Note that the definition shown here is merely representative.

`SIZE_MAX`

#defineSIZE_MAXUINT32_MAX

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`size_t`

.
Note that the definition shown here is merely representative.

`UINT8_C`

,
`UINT16_C`

,
`UINT32_C`

,
`UINT64_C`

#defineUINT8_C(x) (x) #defineUINT16_C(x) (x) #defineUINT32_C(x) ((x) + (UINT32_MAX - UINT32_MAX)) #defineUINT64_C(x) ((x) + (UINT64_MAX - UINT64_MAX))

The macros each convert an integer literal to an unsigned integer type whose representation has at least eight, 16, 32, or 64 bits, respectively. Note that the definitions shown here are merely representative.

`UINT8_MAX`

,
`UINT16_MAX`

,
`UINT32_MAX`

,
`UINT64_MAX`

#defineUINT8_MAX0xff[exact]#defineUINT16_MAX0xffff[exact]#defineUINT32_MAX0xffffffff[exact]#defineUINT64_MAX0xffffffffffffffff[exact]

The macros each expand to an
*#if* expression
that yields the maximum value representable as type
`uint8_t`

,
`uint16_t`

,
`uint32_t`

, or
`uint64_t`

, respectively.
Note that the definitions shown here are *exact.*

`uint8_t`

,
`uint16_t`

,
`uint32_t`

,
`uint64_t`

typedef unsigned charuint8_t; typedef unsigned shortuint16_t; typedef unsigned longuint32_t; typedef unsigned long longuint64_t;

The types each specify an unsigned integer type whose representation has exactly eight, 16, 32, or 64 bits, respectively. Note that the definitions shown here are merely representative.

`UINT_FAST8_MAX`

,
`UINT_FAST16_MAX`

,
`UINT_FAST32_MAX`

,
`UINT_FAST64_MAX`

#defineUINT_FAST8_MAX0xff #defineUINT_FAST16_MAX0xffff #defineUINT_FAST32_MAX0xffffffff #defineUINT_FAST64_MAX0xffffffffffffffff

The macros each expand to an
*#if* expression
that yields the maximum value representable as type
`uint_fast8_t`

,
`uint_fast16_t`

,
`uint_fast32_t`

, or
`uint_fast64_t`

, respectively.
Note that the definitions shown here are merely representative

`uint_fast8_t`

,
`uint_fast16_t`

,
`uint_fast32_t`

,
`uint_fast64_t`

typedef unsigned charuint_fast8_t; typedef unsigned shortuint_fast16_t; typedef unsigned longuint_fast32_t; typedef unsigned long longuint_fast64_t;

The types each specify an unsigned integer type that supports the fastest operations among those whose representation has at least eight, 16, 32, or 64 bits, respectively. Note that the definitions shown here are merely representative.

`UINT_LEAST8_MAX`

,
`UINT_LEAST16_MAX`

,
`UINT_LEAST32_MAX`

,
`UINT_LEAST64_MAX`

#defineUINT_LEAST8_MAX0xff #defineUINT_LEAST16_MAX0xffff #defineUINT_LEAST32_MAX0xffffffff #defineUINT_LEAST64_MAX0xffffffffffffffff

The macros each expand to an
*#if* expression
that yields the maximum value representable as type
`uint_least8_t`

,
`uint_least16_t`

,
`uint_least32_t`

, or
`uint_least64_t`

, respectively.
Note that the definitions shown here are merely representative

`uint_least8_t`

,
`uint_least16_t`

,
`uint_least32_t`

,
`uint_least64_t`

typedef unsigned charuint_least8_t; typedef unsigned shortuint_least16_t; typedef unsigned longuint_least32_t; typedef unsigned long longuint_least64_t;

The types each specify an unsigned integer type whose representation has at least eight, 16, 32, or 64 bits, respectively. Note that the definitions shown here are merely representative.

`UINTMAX_C`

#defineUINTMAX_C(x) ((x) + (UINT64_MAX - UINT64_MAX))

The macro converts an unsuffixed integer literal to the largest unsigned integer type. Note that the definition shown here is merely representative.

`UINTMAX_MAX`

#defineUINTMAX_MAX0xffffffffffffffff

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`uintmax_t`

.
Note that the definition shown here is merely representative.

`uintmax_t`

typedef unsigned long longuintmax_t;

The type specifies the largest unsigned integer type. Note that the definition shown here is merely representative.

`UINTPTR_MAX`

#defineUINTPTR_MAX0xffffffff

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`uintptr_t`

.
Note that the definition shown here is merely representative.

`uintptr_t`

typedef unsigned longuintptr_t;

The type specifies an unsigned integer type large enough to support
interconversion with a void pointer. (You can convert a void pointer to
`uintptr_t`

and back, and the result compares equal to the original
pointer value.)
Note that the definition shown here is merely representative.

`WCHAR_MAX`

#defineWCHAR_MAXUINT16_MAX

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`wchar_t`

.
Note that the definition shown here is merely representative.

`WCHAR_MIN`

#defineWCHAR_MIN0

The macro expands to an
*#if* expression
that yields the minimum value representable as type
`wchar_t`

.
Note that the definition shown here is merely representative.

`WINT_MAX`

#defineWINT_MAXUINT16_MAX

The macro expands to an
*#if* expression
that yields the maximum value representable as type
`wint_t`

.
Note that the definition shown here is merely representative.

`WINT_MIN`

#defineWINT_MIN0

The macro expands to an
*#if* expression
that yields the minimum value representable as type
`wint_t`

.
Note that the definition shown here is merely representative.

*
Copyright © 1992-2006
by P.J. Plauger. All rights reserved.*

Last modified: 2013-12-21