Namespaces
Variants
Views
Actions

Standard library header <cstdint>

From cppreference.com
< cpp‎ | header
Revision as of 09:14, 12 November 2013 by 129.206.61.67 (Talk)

This header was originally in the C standard library as <stdint.h>.

This header is part of the type support library, providing fixed width integer types.

Contents

Types

int8_t
int16_t
int32_t
int64_t
signed integer type with width of
exactly 8, 16, 32 and 64 bits respectively
with no padding bits and using 2's complement for negative values
(provided only if the implementation directly supports the type)
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
fastest signed integer type with width of
at least 8, 16, 32 and 64 bits respectively
int_least8_t
int_least16_t
int_least32_t
int_least64_t
smallest signed integer type with width of
at least 8, 16, 32 and 64 bits respectively
intmax_t maximum width integer type
intptr_t integer type capable of holding a pointer
uint8_t
uint16_t
uint32_t
uint64_t
unsigned integer type with width of
exactly 8, 16, 32 and 64 bits respectively
(provided only if the implementation directly supports the type)
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
fastest unsigned integer type with width of
at least 8, 16, 32 and 64 bits respectively
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
smallest unsigned integer type with width of
at least 8, 16, 32 and 64 bits respectively
uintmax_t maximum width unsigned integer type
uintptr_t unsigned integer type capable of holding a pointer

Macro constants

Signed integers : minimum value
INT8_MININT16_MININT32_MININT64_MIN
minimum value of an object of type int8_t, int16_t, int32_t, int64_t
(macro constant)
INT_FAST8_MININT_FAST16_MININT_FAST32_MININT_FAST64_MIN
minimum value of an object of type int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t
(macro constant)
INT_LEAST8_MININT_LEAST16_MININT_LEAST32_MININT_LEAST64_MIN
minimum value of an object of type int_least8_t, int_least16_t, int_least32_t, int_least64_t
(macro constant)
INTPTR_MIN
minimum value of an object of type intptr_t
(macro constant)
INTMAX_MIN
minimum value of an object of type intmax_t
(macro constant)
Signed integers : maximum value
INT8_MAXINT16_MAXINT32_MAXINT64_MAX
maximum value of an object of type int8_t, int16_t, int32_t, int64_t
(macro constant)
INT_FAST8_MAXINT_FAST16_MAXINT_FAST32_MAXINT_FAST64_MAX
maximum value of an object of type int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t
(macro constant)
INT_LEAST8_MAXINT_LEAST16_MAXINT_LEAST32_MAXINT_LEAST64_MAX
maximum value of an object of type int_least8_t, int_least16_t, int_least32_t, int_least64_t
(macro constant)
INTPTR_MAX
maximum value of an object of type intptr_t
(macro constant)
INTMAX_MAX
maximum value of an object of type intmax_t
(macro constant)
Unsigned integers : maximum value
UINT8_MAXUINT16_MAXUINT32_MAXUINT64_MAX
maximum value of an object of type uint8_t, uint16_t, uint32_t, uint64_t
(macro constant)
UINT_FAST8_MAXUINT_FAST16_MAXUINT_FAST32_MAXUINT_FAST64_MAX
maximum value of an object of type uint_fast8_t, uint_fast16_t, uint_fast32_t, uint_fast64_t
(macro constant)
UINT_LEAST8_MAXUINT_LEAST16_MAXUINT_LEAST32_MAXUINT_LEAST64_MAX
maximum value of an object of type uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t
(macro constant)
UINTPTR_MAX
maximum value of an object of type uintptr_t
(macro constant)
UINTMAX_MAX
maximum value of an object of type uintmax_t
(macro constant)

Synopsis

namespace std {
    typedef /*signed integer type*/ int8_t;  // optional
    typedef /*signed integer type*/ int16_t; // optional
    typedef /*signed integer type*/ int32_t; // optional
    typedef /*signed integer type*/ int64_t; // optional
 
    typedef /*signed integer type*/ int_fast8_t;
    typedef /*signed integer type*/ int_fast16_t;
    typedef /*signed integer type*/ int_fast32_t;
    typedef /*signed integer type*/ int_fast64_t;
 
    typedef /*signed integer type*/ int_least8_t;
    typedef /*signed integer type*/ int_least16_t;
    typedef /*signed integer type*/ int_least32_t;
    typedef /*signed integer type*/ int_least64_t;
 
    typedef /*signed integer type*/ intmax_t;
    typedef /*signed integer type*/ intptr_t; //optional
 
 
    typedef /*unsigned integer type*/ uint8_t;  // optional
    typedef /*unsigned integer type*/ uint16_t; // optional
    typedef /*unsigned integer type*/ uint32_t; // optional
    typedef /*unsigned integer type*/ uint64_t; // optional
 
    typedef /*unsigned integer type*/ uint_fast8_t;
    typedef /*unsigned integer type*/ uint_fast16_t;
    typedef /*unsigned integer type*/ uint_fast32_t;
    typedef /*sunigned integer type*/ uint_fast64_t;
 
    typedef /*unsigned integer type*/ uint_least8_t;
    typedef /*unsigned integer type*/ uint_least16_t;
    typedef /*unsigned integer type*/ uint_least32_t;
    typedef /*unsigned integer type*/ uint_least64_t;
 
    typedef /*unsigned integer type*/ uintmax_t;
    typedef /*unsigned integer type*/ uintptr_t; //optional
 
} // namespace std