inttypes.h stdint.h

inttypes.h stdint.h

时间: 2015-02-28 21:37
作者: lsgxeva
分类:  基础深入 >>language>>C
摘要:  inttypes.h stdint.h
标签:  inttypes.h stdint.h
提示: 文章均来自网络,版权为原作者所有,如有侵犯权益,请联络我们.



一些为了跨平台的数据类型,使用了很奇怪的类型,所以,包了一个头文件<stdint.h>

16位平台

char       1个字节8位
short     2个字节16位
int         2个字节16位
long       4个字节32位
 指针       2个字节

32位平台

char       1个字节8位
short     2个字节16位
int         4个字节32位
long       4个字节
long long 8个字节
 指针       4个字节

64位平台

char       1个字节
short     2个字节
int         4个字节
long       8个字节(区别)
long long 8个字节
 指针     8个字节(区别)


<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 char int8_t;
typedef short int16_t;
typedef long int32_t;
typedef long long int64_t;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef unsigned long long uint64_t;

typedef signed char int_least8_t;
typedef short int_least16_t;
typedef long int_least32_t;
typedef long long int_least64_t;

typedef unsigned char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned long uint_least32_t;
typedef unsigned long long uint_least64_t;

typedef signed char int_fast8_t;
typedef short int_fast16_t;
typedef long int_fast32_t;
typedef long long int_fast64_t;

typedef unsigned char uint_fast8_t;
typedef unsigned short uint_fast16_t;
typedef unsigned long uint_fast32_t;
typedef unsigned long long uint_fast64_t;

typedef long intptr_t;
typedef unsigned long uintptr_t;

typedef long long intmax_t;
typedef unsigned long long uintmax_t;

        /* LIMIT MACROS */
#define INT8_MIN    (-0x7f - 1)
#define INT16_MIN   (-0x7fff - 1)
#define INT32_MIN   (-0x7fffffff - 1)
#define INT64_MIN   (-0x7fffffffffffffff - 1)

#define INT8_MAX    0x7f [exact]
#define INT16_MAX   0x7fff [exact]
#define INT32_MAX   0x7fffffff [exact]
#define INT64_MAX   0x7fffffffffffffff [exact]

#define UINT8_MAX   0xff [exact]
#define UINT16_MAX  0xffff [exact]
#define UINT32_MAX  0xffffffff [exact]
#define UINT64_MAX  0xffffffffffffffff [exact]

#define INT_LEAST8_MIN    (-0x7f - 1)
#define INT_LEAST16_MIN   (-0x7fff - 1)
#define INT_LEAST32_MIN   (-0x7fffffff - 1)
#define INT_LEAST64_MIN   (-0x7fffffffffffffff - 1)

#define INT_LEAST8_MAX    0x7f
#define INT_LEAST16_MAX   0x7fff
#define INT_LEAST32_MAX   0x7fffffff
#define INT_LEAST64_MAX   0x7fffffffffffffff

#define UINT_LEAST8_MAX   0xff
#define UINT_LEAST16_MAX  0xffff
#define UINT_LEAST32_MAX  0xffffffff
#define UINT_LEAST64_MAX  0xffffffffffffffff

#define INT_FAST8_MIN     (-0x7f - 1)
#define INT_FAST16_MIN    (-0x7fff - 1)
#define INT_FAST32_MIN    (-0x7fffffff - 1)
#define INT_FAST64_MIN    (-0x7fffffffffffffff - 1)

#define INT_FAST8_MAX     0x7f
#define INT_FAST16_MAX    0x7fff
#define INT_FAST32_MAX    0x7fffffff
#define INT_FAST64_MAX    0x7fffffffffffffff

#define UINT_FAST8_MAX    0xff
#define UINT_FAST16_MAX   0xffff
#define UINT_FAST32_MAX   0xffffffff
#define UINT_FAST64_MAX   0xffffffffffffffff

#define INTPTR_MIN        (-0x7fffffff - 1)
#define INTPTR_MAX        0x7fffffff
#define UINTPTR_MAX       0xffffffff

#define INT8_C(x)    (x)
#define INT16_C(x)   (x)
#define INT32_C(x)   ((x) + (INT32_MAX - INT32_MAX))
#define INT64_C(x)   ((x) + (INT64_MAX - INT64_MAX))

#define UINT8_C(x)   (x)
#define UINT16_C(x)  (x)
#define UINT32_C(x)  ((x) + (UINT32_MAX - UINT32_MAX))
#define UINT64_C(x)  ((x) + (UINT64_MAX - UINT64_MAX))

#define INTMAX_C(x)  ((x) + (INT64_MAX - INT64_MAX))
#define UINTMAX_C(x) ((x) + (UINT64_MAX - UINT64_MAX))

#define PTRDIFF_MIN  INT32_MIN
#define PTRDIFF_MAX  INT32_MAX

#define SIG_ATOMIC_MIN    INT32_MIN
#define SIG_ATOMIC_MAX    INT32_MAX

#define SIZE_MAX     UINT32_MAX

#define WCHAR_MIN    0
#define WCHAR_MAX    UINT16_MAX

#define WINT_MIN     0
#define WINT_MAX     UINT16_MAX

#define INTMAX_MIN        (-0x7fffffffffffffff - 1)
#define INTMAX_MAX        0x7fffffffffffffff
#define UINTMAX_MAX       0xffffffffffffffff

INT8_C, INT16_C, INT32_C, INT64_C

#define INT8_C(x)    (x)
#define INT16_C(x)   (x)
#define INT32_C(x)   ((x) + (INT32_MAX - INT32_MAX))
#define INT64_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

#define INT8_MAX    0x7f [exact]
#define INT16_MAX   0x7fff [exact]
#define INT32_MAX   0x7fffffff [exact]
#define INT64_MAX   0x7fffffffffffffff [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

#define INT8_MIN    (-0x7f - 1)
#define INT16_MIN   (-0x7fff - 1)
#define INT32_MIN   (-0x7fffffff - 1)
#define INT64_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 char int8_t;
typedef short int16_t;
typedef long int32_t;
typedef long long int64_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

#define INT_FAST8_MAX     0x7f
#define INT_FAST16_MAX    0x7fff
#define INT_FAST32_MAX    0x7fffffff
#define INT_FAST64_MAX    0x7fffffffffffffff

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

#define INT_FAST8_MIN     (-0x7f - 1)
#define INT_FAST16_MIN    (-0x7fff - 1)
#define INT_FAST32_MIN    (-0x7fffffff - 1)
#define INT_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 char int_fast8_t;
typedef short int_fast16_t;
typedef long int_fast32_t;
typedef long long int_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

#define INT_LEAST8_MAX    0x7f
#define INT_LEAST16_MAX   0x7fff
#define INT_LEAST32_MAX   0x7fffffff
#define INT_LEAST64_MAX   0x7fffffffffffffff

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

#define INT_LEAST8_MIN    (-0x7f - 1)
#define INT_LEAST16_MIN   (-0x7fff - 1)
#define INT_LEAST32_MIN   (-0x7fffffff - 1)
#define INT_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 char int_least8_t;
typedef short int_least16_t;
typedef long int_least32_t;
typedef long long int_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

#define INTMAX_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

#define INTMAX_MAX        0x7fffffffffffffff

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

#define INTMAX_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 long intmax_t;

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

INTPTR_MAX

#define INTPTR_MAX        0x7fffffff

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

#define INTPTR_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 long intptr_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

#define PTRDIFF_MAX  INT32_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

#define PTRDIFF_MIN  INT32_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

#define SIG_ATOMIC_MAX    INT32_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

#define SIG_ATOMIC_MIN    INT32_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

#define SIZE_MAX     UINT32_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

#define UINT8_C(x)   (x)
#define UINT16_C(x)  (x)
#define UINT32_C(x)  ((x) + (UINT32_MAX - UINT32_MAX))
#define UINT64_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

#define UINT8_MAX   0xff [exact]
#define UINT16_MAX  0xffff [exact]
#define UINT32_MAX  0xffffffff [exact]
#define UINT64_MAX  0xffffffffffffffff [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 char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef unsigned long long uint64_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

#define UINT_FAST8_MAX    0xff
#define UINT_FAST16_MAX   0xffff
#define UINT_FAST32_MAX   0xffffffff
#define UINT_FAST64_MAX   0xffffffffffffffff

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 char uint_fast8_t;
typedef unsigned short uint_fast16_t;
typedef unsigned long uint_fast32_t;
typedef unsigned long long uint_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

#define UINT_LEAST8_MAX   0xff
#define UINT_LEAST16_MAX  0xffff
#define UINT_LEAST32_MAX  0xffffffff
#define UINT_LEAST64_MAX  0xffffffffffffffff

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 char uint_least8_t;
typedef unsigned short uint_least16_t;
typedef unsigned long uint_least32_t;
typedef unsigned long long uint_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

#define UINTMAX_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

#define UINTMAX_MAX       0xffffffffffffffff

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 long uintmax_t;

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

UINTPTR_MAX

#define UINTPTR_MAX       0xffffffff

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 long uintptr_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

#define WCHAR_MAX    UINT16_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

#define WCHAR_MIN    0

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

#define WINT_MAX     UINT16_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

#define WINT_MIN     0

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 © 1998-2002 by P.J. Plauger. All rights reserved.


来源: <<stdint.h>>
 


<inttypes.h>

[Added with C99]

abs · div · imaxabs · imaxdiv · imaxdiv_t · strtoimax · strtoumax · wcstoimax · wcstoumax

PRId8 · PRId16 · PRId32 · PRId64 · PRIdFAST8 · PRIdFAST16 · PRIdFAST32 · PRIdFAST64 · PRIdLEAST8 · PRIdLEAST16 · PRIdLEAST32 · PRIdLEAST64 · PRIdMAX · PRIdPTR · PRIi8 · PRIi16 · PRIi32 · PRIi64 · PRIiFAST8 · PRIiFAST16 · PRIiFAST32 · PRIiFAST64 · PRIiLEAST8 · PRIiLEAST16 · PRIiLEAST32 · PRIiLEAST64 · PRIiMAX · PRIiPTR · PRIo8 · PRIo16 · PRIo32 · PRIo64 · PRIoFAST8 · PRIoFAST16 · PRIoFAST32 · PRIoFAST64 · PRIoLEAST8 · PRIoLEAST16 · PRIoLEAST32 · PRIoLEAST64 · PRIoMAX · PRIoPTR · PRIu8 · PRIu16 · PRIu32 · PRIu64 · PRIuFAST8 · PRIuFAST16 · PRIuFAST32 · PRIuFAST64 · PRIuLEAST8 · PRIuLEAST16 · PRIuLEAST32 · PRIuLEAST64 · PRIuMAX · PRIuPTR · PRIx8 · PRIx16 · PRIx32 · PRIx64 · PRIxFAST8 · PRIxFAST16 · PRIxFAST32 · PRIxFAST64 · PRIxLEAST8 · PRIxLEAST16 · PRIxLEAST32 · PRIxLEAST64 · PRIxMAX · PRIxPTR · PRIX8 · PRIX16 · PRIX32 · PRIX64 · PRIXFAST8 · PRIXFAST16 · PRIXFAST32 · PRIXFAST64 · PRIXLEAST8 · PRIXLEAST16 · PRIXLEAST32 · PRIXLEAST64 · PRIXMAX · PRIXPTR

SCNd8 · SCNd16 · SCNd32 · SCNd64 · SCNdFAST8 · SCNdFAST16 · SCNdFAST32 · SCNdFAST64 · SCNdLEAST8 · SCNdLEAST16 · SCNdLEAST32 · SCNdLEAST64 · SCNdMAX · SCNdPTR · SCNi8 · SCNi16 · SCNi32 · SCNi64 · SCNiFAST8 · SCNiFAST16 · SCNiFAST32 · SCNiFAST64 · SCNiLEAST8 · SCNiLEAST16 · SCNiLEAST32 · SCNiLEAST64 · SCNiMAX · SCNiPTR · SCNo8 · SCNo16 · SCNo32 · SCNo64 · SCNoFAST8 · SCNoFAST16 · SCNoFAST32 · SCNoFAST64 · SCNoLEAST8 · SCNoLEAST16 · SCNoLEAST32 · SCNoLEAST64 · SCNoMAX · SCNoPTR · SCNu8 · SCNu16 · SCNu32 · SCNu64 · SCNuFAST8 · SCNuFAST16 · SCNuFAST32 · SCNuFAST64 · SCNuLEAST8 · SCNuLEAST16 · SCNuLEAST32 · SCNuLEAST64 · SCNuMAX · SCNuPTR · SCNx8 · SCNx16 · SCNx32 · SCNx64 · SCNxFAST8 · SCNxFAST16 · SCNxFAST32 · SCNxFAST64 · SCNxLEAST8 · SCNxLEAST16 · SCNxLEAST32 · SCNxLEAST64 · SCNxMAX · SCNxPTR · SCNX8 · SCNX16 · SCNX32 · SCNX64 · SCNXFAST8 · SCNXFAST16 · SCNXFAST32 · SCNXFAST64 · SCNXLEAST8 · SCNXLEAST16 · SCNXLEAST32 · SCNXLEAST64 · SCNXMAX · SCNXPTR

Include the standard header <inttypes.h> to define a type, several functions, and numerous macros for fine control over the conversion of integers. Note that the definitions shown for the macros are merely representative -- they can vary among implementations.

        /* TYPE DEFINITIONS */
typedef struct {
    intmax_t quot, rem;
    } imaxdiv_t;

        /* FUNCTION DECLARATIONS */
intmax_t imaxabs(intmax_t i);
intmax_t abs(intmax_t i); [C++ only]

imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
imaxdiv_t div(intmax_t numer, intmax_t denom); [C++ only]

intmax_t strtoimax(const char *restrict s,
    char **restrict endptr, int base);
uintmax_t strtoumax(const char *restrict s,
    char **restrict endptr, int base);
intmax_t wcstoimax(const wchar_t *restrict s,
    wchar_t **restrict endptr, int base);
uintmax_t wcstoumax(const wchar_t *restrict s,
    wchar_t **restrict endptr, int base);

        /* PRINT FORMAT MACROS */
#define PRId8     "hhd"
#define PRId16    "hd"
#define PRId32    "ld"
#define PRId64    "lld"

#define PRIdFAST8    "hhd"
#define PRIdFAST16    "hd"
#define PRIdFAST32    "ld"
#define PRIdFAST64   "lld"

#define PRIdLEAST8   "hhd"
#define PRIdLEAST16  "hd"
#define PRIdLEAST32  "ld"
#define PRIdLEAST64  "lld"

#define PRIdMAX   "lld"
#define PRIdPTR   "lld"

#define PRIi8     "hhi"
#define PRIi16    "hi"
#define PRIi32    "li"
#define PRIi64    "lli"

#define PRIiFAST8    "hhi"
#define PRIiFAST16    "hi"
#define PRIiFAST32    "li"
#define PRIiFAST64    "lli"

#define PRIiLEAST8   "hhi"
#define PRIiLEAST16  "hi"
#define PRIiLEAST32  "li"
#define PRIiLEAST64  "lli"

#define PRIiMAX   "lli"
#define PRIiPTR   "lli"

#define PRIo8     "hho"
#define PRIo16    "ho"
#define PRIo32    "lo"
#define PRIo64    "llo"

#define PRIoFAST8    "hho"
#define PRIoFAST16    "ho"
#define PRIoFAST32    "lo"
#define PRIoFAST64   "llo"

#define PRIoLEAST8   "hho"
#define PRIoLEAST16  "ho"
#define PRIoLEAST32  "lo"
#define PRIoLEAST64  "llo"

#define PRIoMAX   "llo"
#define PRIoPTR   "llo"

#define PRIu8     "hhu"
#define PRIu16    "hu"
#define PRIu32    "lu"
#define PRIu64    "llu"

#define PRIuFAST8    "hhu"
#define PRIuFAST16    "hu"
#define PRIuFAST32    "lu"
#define PRIuFAST64   "llu"

#define PRIuLEAST8   "hhu"
#define PRIuLEAST16  "hu"
#define PRIuLEAST32  "lu"
#define PRIuLEAST64  "llu"

#define PRIuMAX   "llu"
#define PRIuPTR   "llu"

#define PRIx8     "hhx"
#define PRIx16    "hx"
#define PRIx32    "lx"
#define PRIx64    "llx"

#define PRIxFAST8    "hhx"
#define PRIxFAST16    "hx"
#define PRIxFAST32    "lx"
#define PRIxFAST64   "llx"

#define PRIxLEAST8   "hhx"
#define PRIxLEAST16  "hx"
#define PRIxLEAST32  "lx"
#define PRIxLEAST64  "llx"

#define PRIxMAX   "llx"
#define PRIxPTR   "llx"

#define PRIX8     "hhX"
#define PRIX16    "hX"
#define PRIX32    "lX"
#define PRIX64    "llX"

#define PRIXFAST8    "hhX"
#define PRIXFAST16    "hX"
#define PRIXFAST32    "lX"
#define PRIXFAST64   "llX"

#define PRIXLEAST8   "hhX"
#define PRIXLEAST16  "hX"
#define PRIXLEAST32  "lX"
#define PRIXLEAST64  "llX"

#define PRIXMAX   "llX"
#define PRIXPTR   "llX"

        /* SCAN FORMAT MACROS */
#define SCNd8     "hhd"
#define SCNd16    "hd"
#define SCNd32    "ld"
#define SCNd64    "lld"

#define SCNdFAST8    "hhd"
#define SCNdFAST16    "hd"
#define SCNdFAST32    "ld"
#define SCNdFAST64   "lld"

#define SCNdLEAST8   "hhd"
#define SCNdLEAST16  "hd"
#define SCNdLEAST32  "ld"
#define SCNdLEAST64  "lld"

#define SCNdMAX   "lld"
#define SCNdPTR   "lld"

#define SCNi8     "hhi"
#define SCNi16    "hi"
#define SCNi32    "li"
#define SCNi64    "lli"

#define SCNiFAST8    "hhi"
#define SCNiFAST16    "hi"
#define SCNiFAST32    "li"
#define SCNiFAST64   "lli"

#define SCNiLEAST8   "hhi"
#define SCNiLEAST16  "hi"
#define SCNiLEAST32  "li"
#define SCNiLEAST64  "lli"

#define SCNiMAX   "lli"
#define SCNiPTR   "lli"

#define SCNo8     "hho"
#define SCNo16    "ho"
#define SCNo32    "lo"
#define SCNo64    "llo"

#define SCNoFAST8    "hho"
#define SCNoFAST16    "ho"
#define SCNoFAST32    "lo"
#define SCNoFAST64   "llo"

#define SCNoLEAST8   "hho"
#define SCNoLEAST16  "ho"
#define SCNoLEAST32  "lo"
#define SCNoLEAST64  "llo"

#define SCNoMAX   "llo"
#define SCNoPTR   "llo"

#define SCNu8     "hhu"
#define SCNu16    "hu"
#define SCNu32    "lu"
#define SCNu64    "llu"

#define SCNuFAST8    "hhu"
#define SCNuFAST16    "hu"
#define SCNuFAST32    "lu"
#define SCNuFAST64   "llu"

#define SCNuLEAST8   "hhu"
#define SCNuLEAST16  "hu"
#define SCNuLEAST32  "lu"
#define SCNuLEAST64  "llu"

#define SCNuMAX   "llu"
#define SCNuPTR   "llu"

#define SCNx8     "hhx"
#define SCNx16    "hx"
#define SCNx32    "lx"
#define SCNx64    "llx"

#define SCNxFAST8    "hhx"
#define SCNxFAST16    "hx"
#define SCNxFAST32    "lx"
#define SCNxFAST64   "llx"

#define SCNxLEAST8   "hhx"
#define SCNxLEAST16  "hx"
#define SCNxLEAST32  "lx"
#define SCNxLEAST64  "llx"

#define SCNxMAX   "llx"
#define SCNxPTR   "llx"

#define SCNX8     "hhX"
#define SCNX16    "hX"
#define SCNX32    "lX"
#define SCNX64    "llX"

#define SCNXFAST8    "hhX"
#define SCNXFAST16    "hX"
#define SCNXFAST32    "lX"
#define SCNXFAST64   "llX"

#define SCNXLEAST8   "hhX"
#define SCNXLEAST16  "hX"
#define SCNXLEAST32  "lX"
#define SCNXLEAST64  "llX"

#define SCNXMAX   "llX"
#define SCNXPTR   "llX"

imaxabs, abs

intmax_t imaxabs(intmax_t i);
intmax_t abs(intmax_t i); [C++ only]

The function returns the absolute value of i, |i|.

imaxdiv, div

imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
imaxdiv_t div(intmax_t numer, intmax_t denom); [C++ only]

The function divides numer by denom and returns both quotient and remainder in the structure result x, if the quotient can be represented. The structure member x.quot is the algebraic quotient truncated toward zero. The structure member x.rem is the remainder, such that numer == x.quot*denom + x.rem.

imaxdiv_t

typedef struct {
    intmax_t quot, rem;
    } imaxdiv_t;

The type is the structure type returned by the function imaxdiv. The structure contains members that represent the quotient (quot) and remainder (rem) of a signed integer division with operands of type intmax_t. The members shown above can occur in either order.

PRId8, PRId16, PRId32, PRId64

#define PRId8     "hhd"
#define PRId16    "hd"
#define PRId32    "ld"
#define PRId64    "lld"

The macros each expand to a string literal suitable for use as a d print conversion specificier, plus any needed qualifiers, to convert values of the types int8_t, int16_t, int32_t, or int64_t, respectively. Note that the definitions shown here are merely representative.

PRIdFAST8, PRIdFAST16, PRIdFAST32, PRIdFAST64

#define PRIdFAST8    "hhd"
#define PRIdFAST16    "hd"
#define PRIdFAST32    "ld"
#define PRIdFAST64   "lld"

The macros each expand to a string literal suitable for use as a d print conversion specificier, plus any needed qualifiers, to convert values of the types int_fast8_t, int_fast16_t, int_fast32_t, or int_fast64_t, respectively. Note that the definitions shown here are merely representative.

PRIdLEAST8, PRIdLEAST16, PRIdLEAST32, PRIdLEAST64

#define PRIdLEAST8   "hhd"
#define PRIdLEAST16  "hd"
#define PRIdLEAST32  "ld"
#define PRIdLEAST64  "lld"

The macros each expand to a string literal suitable for use as a d print conversion specificier, plus any needed qualifiers, to convert values of the types int_least8_t, int_least16_t, int_least32_t, or int_least64_t, respectively. Note that the definitions shown here are merely representative.

PRIdMAX

#define PRIdMAX   "lld"

The macro expands to a string literal suitable for use as a d print conversion specificier, plus any needed qualifiers, to convert values of the types intmax_t. Note that the definition shown here is merely representative.

PRIdPTR

#define PRIdPTR   "lld"

The macro expands to a string literal suitable for use as a d print conversion specificier, plus any needed qualifiers, to convert values of the types intptr_t. Note that the definition shown here is merely representative.

PRIi8, PRIi16, PRIi32, PRIi64

#define PRIi8     "hhi"
#define PRIi16    "hi"
#define PRIi32    "li"
#define PRIi64    "lli"

The macros each expand to a string literal suitable for use as an i print conversion specificier, plus any needed qualifiers, to convert values of the types int8_t, int16_t, int32_t, or int64_t, respectively. Note that the definitions shown here are merely representative.

PRIiFAST8, PRIiFAST16, PRIiFAST32, PRIiFAST64

#define PRIiFAST8    "hhi"
#define PRIiFAST16    "hi"
#define PRIiFAST32    "li"
#define PRIiFAST64   "lli"

The macros each expand to a string literal suitable for use as an i print conversion specificier, plus any needed qualifiers, to convert values of the types int_fast8_t, int_fast16_t, int_fast32_t, or int_fast64_t, respectively. Note that the definitions shown here are merely representative.

PRIiLEAST8, PRIiLEAST16, PRIiLEAST32, PRIiLEAST64

#define PRIiLEAST8   "hhi"
#define PRIiLEAST16  "hi"
#define PRIiLEAST32  "li"
#define PRIiLEAST64  "lli"

The macros each expand to a string literal suitable for use as an i print conversion specificier, plus any needed qualifiers, to convert values of the types int_least8_t, int_least16_t, int_least32_t, or int_least64_t, respectively. Note that the definitions shown here are merely representative.

PRIiMAX

#define PRIiMAX   "lli"

The macro expands to a string literal suitable for use as an i print conversion specificier, plus any needed qualifiers, to convert values of the types intmax_t. Note that the definition shown here is merely representative.

PRIiPTR

#define PRIiPTR   "lli"

The macro expands to a string literal suitable for use as an i print conversion specificier, plus any needed qualifiers, to convert values of the types intptr_t. Note that the definition shown here is merely representative.

PRIo8, PRIo16, PRIo32, PRIo64

#define PRIo8     "hho"
#define PRIo16    "ho"
#define PRIo32    "lo"
#define PRIo64    "llo"

The macros each expand to a string literal suitable for use as an o print conversion specificier, plus any needed qualifiers, to convert values of the types uint8_t, uint16_t, uint32_t, or uint64_t, respectively. Note that the definitions shown here are merely representative.

PRIoFAST8, PRIoFAST16, PRIoFAST32, PRIoFAST64

#define PRIoFAST8    "hho"
#define PRIoFAST16    "ho"
#define PRIoFAST32    "lo"
#define PRIoFAST64   "llo"

The macros each expand to a string literal suitable for use as an o print conversion specificier, plus any needed qualifiers, to convert values of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, or uint_fast64_t, respectively. Note that the definitions shown here are merely representative.

PRIoLEAST8, PRIoLEAST16, PRIoLEAST32, PRIoLEAST64

#define PRIoLEAST8   "hho"
#define PRIoLEAST16  "ho"
#define PRIoLEAST32  "lo"
#define PRIoLEAST64  "llo"

The macros each expand to a string literal suitable for use as an o print conversion specificier, plus any needed qualifiers, to convert values of the types uint_least8_t, uint_least16_t, uint_least32_t, or uint_least64_t, respectively. Note that the definitions shown here are merely representative.

PRIoMAX

#define PRIoMAX   "llo"

The macro expands to a string literal suitable for use as an o print conversion specificier, plus any needed qualifiers, to convert values of the types uintmax_t. Note that the definition shown here is merely representative.

PRIoPTR

#define PRIoPTR   "llo"

The macro expands to a string literal suitable for use as an o print conversion specificier, plus any needed qualifiers, to convert values of the types uintptr_t. Note that the definition shown here is merely representative.

PRIu8, PRIu16, PRIu32, PRIu64

#define PRIu8     "hhu"
#define PRIu16    "hu"
#define PRIu32    "lu"
#define PRIu64    "llu"

The macros each expand to a string literal suitable for use as a u print conversion specificier, plus any needed qualifiers, to convert values of the types uint8_t, uint16_t, uint32_t, or uint64_t, respectively. Note that the definitions shown here are merely representative.

PRIuFAST8, PRIuFAST16, PRIuFAST32, PRIuFAST64

#define PRIuFAST8    "hhu"
#define PRIuFAST16    "hu"
#define PRIuFAST32    "lu"
#define PRIuFAST64   "llu"

The macros each expand to a string literal suitable for use as a u print conversion specificier, plus any needed qualifiers, to convert values of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, or uint_fast64_t, respectively. Note that the definitions shown here are merely representative.

PRIuLEAST8, PRIuLEAST16, PRIuLEAST32, PRIuLEAST64

#define PRIuLEAST8   "hhu"
#define PRIuLEAST16  "hu"
#define PRIuLEAST32  "lu"
#define PRIuLEAST64  "llu"

The macros each expand to a string literal suitable for use as a u print conversion specificier, plus any needed qualifiers, to convert values of the types uint_least8_t, uint_least16_t, uint_least32_t, or uint_least64_t, respectively. Note that the definitions shown here are merely representative.

PRIuMAX

#define PRIuMAX   "llu"

The macro expands to a string literal suitable for use as a u print conversion specificier, plus any needed qualifiers, to convert values of the types uintmax_t. Note that the definition shown here is merely representative.

PRIuPTR

#define PRIuPTR   "llu"

The macro expands to a string literal suitable for use as a u print conversion specificier, plus any needed qualifiers, to convert values of the types uintptr_t. Note that the definition shown here is merely representative.

PRIx8, PRIx16, PRIx32, PRIx64

#define PRIx8     "hhx"
#define PRIx16    "hx"
#define PRIx32    "lx"
#define PRIx64    "llx"

The macros each expand to a string literal suitable for use as an x print conversion specificier, plus any needed qualifiers, to convert values of the types uint8_t, uint16_t, uint32_t, or uint64_t, respectively. Note that the definitions shown here are merely representative.

PRIxFAST8, PRIxFAST16, PRIxFAST32, PRIxFAST64

#define PRIxFAST8    "hhx"
#define PRIxFAST16    "hx"
#define PRIxFAST32    "lx"
#define PRIxFAST64   "llx"

The macros each expand to a string literal suitable for use as an x print conversion specificier, plus any needed qualifiers, to convert values of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, or uint_fast64_t, respectively. Note that the definitions shown here are merely representative.

PRIxLEAST8, PRIxLEAST16, PRIxLEAST32, PRIxLEAST64

#define PRIxLEAST8   "hhx"
#define PRIxLEAST16  "hx"
#define PRIxLEAST32  "lx"
#define PRIxLEAST64  "llx"

The macros each expand to a string literal suitable for use as an x print conversion specificier, plus any needed qualifiers, to convert values of the types uint_least8_t, uint_least16_t, uint_least32_t, or uint_least64_t, respectively. Note that the definitions shown here are merely representative.

PRIxMAX

#define PRIxMAX   "llx"

The macro expands to a string literal suitable for use as an x print conversion specificier, plus any needed qualifiers, to convert values of the types uintmax_t. Note that the definition shown here is merely representative.

PRIxPTR

#define PRIxPTR   "llx"

The macro expands to a string literal suitable for use as an x print conversion specificier, plus any needed qualifiers, to convert values of the types uintptr_t. Note that the definition shown here is merely representative.

PRIX8, PRIX16, PRIX32, PRIX64

#define PRIX8     "hhX"
#define PRIX16    "hX"
#define PRIX32    "lX"
#define PRIX64    "llX"

The macros each expand to a string literal suitable for use as an X print conversion specificier, plus any needed qualifiers, to convert values of the types uint8_t, uint16_t, uint32_t, or uint64_t, respectively. Note that the definitions shown here are merely representative.

PRIXFAST8, PRIXFAST16, PRIXFAST32, PRIXFAST64

#define PRIXFAST8    "hhX"
#define PRIXFAST16    "hX"
#define PRIXFAST32    "lX"
#define PRIXFAST64   "llX"

The macros each expand to a string literal suitable for use as an X print conversion specificier, plus any needed qualifiers, to convert values of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, or uint_fast64_t, respectively. Note that the definitions shown here are merely representative.

PRIXLEAST8, PRIXLEAST16, PRIXLEAST32, PRIXLEAST64

#define PRIXLEAST8   "hhX"
#define PRIXLEAST16  "hX"
#define PRIXLEAST32  "lX"
#define PRIXLEAST64  "llX"

The macros each expand to a string literal suitable for use as an X print conversion specificier, plus any needed qualifiers, to convert values of the types uint_least8_t, uint_least16_t, uint_least32_t, or uint_least64_t, respectively. Note that the definitions shown here are merely representative.

PRIXMAX

#define PRIXMAX   "llX"

The macro expands to a string literal suitable for use as an X print conversion specificier, plus any needed qualifiers, to convert values of the types uintmax_t. Note that the definition shown here is merely representative.

PRIXPTR

#define PRIXPTR   "llX"

The macro expands to a string literal suitable for use as an X print conversion specificier, plus any needed qualifiers, to convert values of the types uintptr_t. Note that the definition shown here is merely representative.

SCNd8, SCNd16, SCNd32, SCNd64

#define SCNd8     "hhd"
#define SCNd16    "hd"
#define SCNd32    "ld"
#define SCNd64    "lld"

The macros each expand to a string literal suitable for use as a d scan conversion specificier, plus any needed qualifiers, to convert values of the types int8_t, int16_t, int32_t, or int64_t, respectively. Note that the definitions shown here are merely representative.

SCNdFAST8, SCNdFAST16, SCNdFAST32, SCNdFAST64

#define SCNdFAST8    "hhd"
#define SCNdFAST16    "hd"
#define SCNdFAST32    "ld"
#define SCNdFAST64   "lld"

The macros each expand to a string literal suitable for use as a d scan conversion specificier, plus any needed qualifiers, to convert values of the types int_fast8_t, int_fast16_t, int_fast32_t, or int_fast64_t, respectively. Note that the definitions shown here are merely representative.

SCNdLEAST8, SCNdLEAST16, SCNdLEAST32, SCNdLEAST64

#define SCNdLEAST8   "hhd"
#define SCNdLEAST16  "hd"
#define SCNdLEAST32  "ld"
#define SCNdLEAST64  "lld"

The macros each expand to a string literal suitable for use as a d scan conversion specificier, plus any needed qualifiers, to convert values of the types int_least8_t, int_least16_t, int_least32_t, or int_least64_t, respectively. Note that the definitions shown here are merely representative.

SCNdMAX

#define SCNdMAX   "lld"

The macro expands to a string literal suitable for use as a d scan conversion specificier, plus any needed qualifiers, to convert values of the types intmax_t. Note that the definition shown here is merely representative.

SCNdPTR

#define SCNdPTR   "lld"

The macro expands to a string literal suitable for use as a d scan conversion specificier, plus any needed qualifiers, to convert values of the types intptr_t. Note that the definition shown here is merely representative.

SCNi8, SCNi16, SCNi32, SCNi64

#define SCNi8     "hhi"
#define SCNi16    "hi"
#define SCNi32    "li"
#define SCNi64    "lli"

The macros each expand to a string literal suitable for use as an i scan conversion specificier, plus any needed qualifiers, to convert values of the types int8_t, int16_t, int32_t, or int64_t, respectively. Note that the definitions shown here are merely representative.

SCNiFAST8, SCNiFAST16, SCNiFAST32, SCNiFAST64

#define SCNiFAST8    "hhi"
#define SCNiFAST16    "hi"
#define SCNiFAST32    "li"
#define SCNiFAST64   "lli"

The macros each expand to a string literal suitable for use as an i scan conversion specificier, plus any needed qualifiers, to convert values of the types int_fast8_t, int_fast16_t, int_fast32_t, or int_fast64_t, respectively. Note that the definitions shown here are merely representative.

SCNiLEAST8, SCNiLEAST16, SCNiLEAST32, SCNiLEAST64

#define SCNiLEAST8   "hhi"
#define SCNiLEAST16  "hi"
#define SCNiLEAST32  "li"
#define SCNiLEAST64  "lli"

The macros each expand to a string literal suitable for use as an i scan conversion specificier, plus any needed qualifiers, to convert values of the types int_least8_t, int_least16_t, int_least32_t, or int_least64_t, respectively. Note that the definitions shown here are merely representative.

SCNiMAX

#define SCNiMAX   "lli"

The macro expands to a string literal suitable for use as an i scan conversion specificier, plus any needed qualifiers, to convert values of the types intmax_t. Note that the definition shown here is merely representative.

SCNiPTR

#define SCNiPTR   "lli"

The macro expands to a string literal suitable for use as an i scan conversion specificier, plus any needed qualifiers, to convert values of the types intptr_t. Note that the definition shown here is merely representative.

SCNo8, SCNo16, SCNo32, SCNo64

#define SCNo8     "hho"
#define SCNo16    "ho"
#define SCNo32    "lo"
#define SCNo64    "llo"

The macros each expand to a string literal suitable for use as an o scan conversion specificier, plus any needed qualifiers, to convert values of the types uint8_t, uint16_t, uint32_t, or uint64_t, respectively. Note that the definitions shown here are merely representative.

SCNoFAST8, SCNoFAST16, SCNoFAST32, SCNoFAST64

#define SCNoFAST8    "hho"
#define SCNoFAST16    "ho"
#define SCNoFAST32    "lo"
#define SCNoFAST64   "llo"

The macros each expand to a string literal suitable for use as an o scan conversion specificier, plus any needed qualifiers, to convert values of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, or uint_fast64_t, respectively. Note that the definitions shown here are merely representative.

SCNoLEAST8, SCNoLEAST16, SCNoLEAST32, SCNoLEAST64

#define SCNoLEAST8   "hho"
#define SCNoLEAST16  "ho"
#define SCNoLEAST32  "lo"
#define SCNoLEAST64  "llo"

The macros each expand to a string literal suitable for use as an o scan conversion specificier, plus any needed qualifiers, to convert values of the types uint_least8_t, uint_least16_t, uint_least32_t, or uint_least64_t, respectively. Note that the definitions shown here are merely representative.

SCNoMAX

#define SCNoMAX   "llo"

The macro expands to a string literal suitable for use as an o scan conversion specificier, plus any needed qualifiers, to convert values of the types uintmax_t. Note that the definition shown here is merely representative.

SCNoPTR

#define SCNoPTR   "llo"

The macro expands to a string literal suitable for use as an o scan conversion specificier, plus any needed qualifiers, to convert values of the types uintptr_t. Note that the definition shown here is merely representative.

SCNu8, SCNu16, SCNu32, SCNu64

#define SCNu8     "hhu"
#define SCNu16    "hu"
#define SCNu32    "lu"
#define SCNu64    "llu"

The macros each expand to a string literal suitable for use as a u scan conversion specificier, plus any needed qualifiers, to convert values of the types uint8_t, uint16_t, uint32_t, or uint64_t, respectively. Note that the definitions shown here are merely representative.

SCNuFAST8, SCNuFAST16, SCNuFAST32, SCNuFAST64

#define SCNuFAST8    "hhu"
#define SCNuFAST16    "hu"
#define SCNuFAST32    "lu"
#define SCNuFAST64   "llu"

The macros each expand to a string literal suitable for use as a u scan conversion specificier, plus any needed qualifiers, to convert values of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, or uint_fast64_t, respectively. Note that the definitions shown here are merely representative.

SCNuLEAST8, SCNuLEAST16, SCNuLEAST32, SCNuLEAST64

#define SCNuLEAST8   "hhu"
#define SCNuLEAST16  "hu"
#define SCNuLEAST32  "lu"
#define SCNuLEAST64  "llu"

The macros each expand to a string literal suitable for use as a u scan conversion specificier, plus any needed qualifiers, to convert values of the types uint_least8_t, uint_least16_t, uint_least32_t, or uint_least64_t, respectively. Note that the definitions shown here are merely representative.

SCNuMAX

#define SCNuMAX   "llu"

The macro expands to a string literal suitable for use as a u scan conversion specificier, plus any needed qualifiers, to convert values of the types uintmax_t. Note that the definition shown here is merely representative.

SCNuPTR

#define SCNuPTR   "llu"

The macro expands to a string literal suitable for use as a u scan conversion specificier, plus any needed qualifiers, to convert values of the types uintptr_t. Note that the definition shown here is merely representative.

SCNx8, SCNx16, SCNx32, SCNx64

#define SCNx8     "hhx"
#define SCNx16    "hx"
#define SCNx32    "lx"
#define SCNx64    "llx"

The macros each expand to a string literal suitable for use as an x scan conversion specificier, plus any needed qualifiers, to convert values of the types uint8_t, uint16_t, uint32_t, or uint64_t, respectively. Note that the definitions shown here are merely representative.

SCNxFAST8, SCNxFAST16, SCNxFAST32, SCNxFAST64

#define SCNxFAST8    "hhx"
#define SCNxFAST16    "hx"
#define SCNxFAST32    "lx"
#define SCNxFAST64   "llx"

The macros each expand to a string literal suitable for use as an x scan conversion specificier, plus any needed qualifiers, to convert values of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, or uint_fast64_t, respectively. Note that the definitions shown here are merely representative.

SCNxLEAST8, SCNxLEAST16, SCNxLEAST32, SCNxLEAST64

#define SCNxLEAST8   "hhx"
#define SCNxLEAST16  "hx"
#define SCNxLEAST32  "lx"
#define SCNxLEAST64  "llx"

The macros each expand to a string literal suitable for use as an x scan conversion specificier, plus any needed qualifiers, to convert values of the types uint_least8_t, uint_least16_t, uint_least32_t, or uint_least64_t, respectively. Note that the definitions shown here are merely representative.

SCNxMAX

#define SCNxMAX   "llx"

The macro expands to a string literal suitable for use as an x scan conversion specificier, plus any needed qualifiers, to convert values of the types uintmax_t. Note that the definition shown here is merely representative.

SCNxPTR

#define SCNxPTR   "llx"

The macro expands to a string literal suitable for use as an x scan conversion specificier, plus any needed qualifiers, to convert values of the types uintptr_t. Note that the definition shown here is merely representative.

SCNX8, SCNX16, SCNX32, SCNX64

#define SCNX8     "hhX"
#define SCNX16    "hX"
#define SCNX32    "lX"
#define SCNX64    "llX"

The macros each expand to a string literal suitable for use as an X scan conversion specificier, plus any needed qualifiers, to convert values of the types uint8_t, uint16_t, uint32_t, or uint64_t, respectively. Note that the definitions shown here are merely representative.

SCNXFAST8, SCNXFAST16, SCNXFAST32, SCNXFAST64

#define SCNXFAST8    "hhX"
#define SCNXFAST16    "hX"
#define SCNXFAST32    "lX"
#define SCNXFAST64   "llX"

The macros each expand to a string literal suitable for use as an X scan conversion specificier, plus any needed qualifiers, to convert values of the types uint_fast8_t, uint_fast16_t, uint_fast32_t, or uint_fast64_t, respectively. Note that the definitions shown here are merely representative.

SCNXLEAST8, SCNXLEAST16, SCNXLEAST32, SCNXLEAST64

#define SCNXLEAST8   "hhX"
#define SCNXLEAST16  "hX"
#define SCNXLEAST32  "lX"
#define SCNXLEAST64  "llX"

The macros each expand to a string literal suitable for use as an X scan conversion specificier, plus any needed qualifiers, to convert values of the types uint_least8_t, uint_least16_t, uint_least32_t, or uint_least64_t, respectively. Note that the definitions shown here are merely representative.

SCNXMAX

#define SCNXMAX   "llX"

The macro expands to a string literal suitable for use as an X scan conversion specificier, plus any needed qualifiers, to convert values of the types uintmax_t. Note that the definition shown here is merely representative.

SCNXPTR

#define SCNXPTR   "llX"

The macro expands to a string literal suitable for use as an X scan conversion specificier, plus any needed qualifiers, to convert values of the types uintptr_t. Note that the definition shown here is merely representative.

strtoimax

intmax_t strtoimax(const char *restrict s, char **restrict endptr,
    int base);

The function converts the initial characters of the string s to an equivalent value x of type intmax_t. If endptr is not a null pointer, it stores a pointer to the unconverted remainder of the string in *endptr. The function then returns x. strtoimax converts strings exactly as does strtol.

If the string s does not match a valid pattern, the value stored in *endptr is s, and x is zero. If the equivalent value is too large to represent as type intmax_t, strtoimax stores the value of ERANGE in errno and returns either INTMAX_MAX, if x is positive, or INTMAX_MIN, if x is negative.

strtoumax

uintmax_t strtoumax(const char *restrict s, char **restrict endptr,
    int base);

The function converts the initial characters of the string s to an equivalent value x of type uintmax_t. If endptr is not a null pointer, it stores a pointer to the unconverted remainder of the string in *endptr. The function then returns x. strtoumax converts strings exactly as does strtoul.

If the string s does not match a valid pattern, the value stored in *endptr is s, and x is zero. If the equivalent value is too large to represent as type uintmax_t, strtoumax stores the value of ERANGE in errno and returns UINTMAX_MAX.

wcstoimax

intmax_t wcstoll(const wchar_t *restrict s, wchar_t **restrict endptr,
    int base);

The function converts the initial wide characters of the wide string s to an equivalent value x of type intmax_t. If endptr is not a null pointer, the function stores a pointer to the unconverted remainder of the wide string in *endptr. The function then returns x.

The initial wide characters of the wide string s must match the same pattern as recognized by the function strtol, with the same base argument, where each wide character wc is converted as if by calling wctob(wc)).

If the wide string s matches this pattern, wcstoimax converts strings exactly as does strtol, with the same base argument, for the converted sequence. If the wide string s does not match a valid pattern, the value stored in *endptr is s, and x is zero. If the equivalent value is too large in magnitude to represent as type intmax_t, wcstoimax stores the value of ERANGE in errno and returns either INTMAX_MAX, if x is positive, or INTMAX_MIN, if x is negative.

wcstoumax

uintmax_t wcstoumax(const wchar_t *restrict s,
     wchar_t **restrict endptr, int base);

The function converts the initial wide characters of the wide string s to an equivalent value x of type uintmax_t. If endptr is not a null pointer, the function stores a pointer to the unconverted remainder of the wide string in *endptr. The function then returns x.

The initial wide characters of the wide string s must match the same pattern as recognized by the function strtol, with the same base argument, where each wide character wc is converted as if by calling wctob(wc)).

If the wide string s matches this pattern, wcstoumax converts strings exactly as does strtol, with the same base argument, for the converted sequence. If the wide string s does not match a valid pattern, the value stored in *endptr is s, and x is zero. If the equivalent value is too large to represent as type uintmax_t, wcstoimax stores the value of ERANGE in errno and returns UINTMAX_MAX.

See also the Table of Contents and the Index.

Copyright © 1998-2002 by P.J. Plauger. All rights reserved.


来源: <<inttypes.h>>
 





来自为知笔记(Wiz)


附件列表

     

    你可能感兴趣的:(inttypes.h stdint.h)