Namespaces
Variants

Standard library header <cstdint> (C++11)

From cppreference.net
Standard library headers

이 헤더는 원래 C 표준 라이브러리에 <stdint.h> 로 존재했습니다.

이 헤더는 타입 지원 라이브러리의 일부로, 고정 너비 정수 타입 C 숫자 한계 인터페이스 의 일부를 제공합니다.

목차

타입

int8_t int16_t int32_t int64_t
(optional)
각각 정확히 8, 16, 32, 64비트 너비를 가지는 부호 있는 정수형
패딩 비트 없이 2의 보수 방식으로 음수 값을 표현
(구현이 해당 타입을 직접 지원하는 경우에만 제공됨)
(typedef)
int_fast8_t int_fast16_t int_fast32_t int_fast64_t
각각 최소 8, 16, 32, 64비트 너비를 갖는 가장 빠른 부호 있는 정수형
(typedef)
int_least8_t int_least16_t int_least32_t int_least64_t
각각 최소 8, 16, 32, 64비트 너비를 갖는 가장 작은 부호 있는 정수형
(typedef)
intmax_t
최대 너비 부호 있는 정수형
(typedef)
intptr_t
(optional)
void 포인터를 보유할 수 있는 부호 있는 정수형 void
(typedef)
uint8_t uint16_t uint32_t uint64_t
(optional)
각각 정확히 8, 16, 32 및 64비트 너비를 갖는 부호 없는 정수형
(구현이 해당 타입을 직접 지원하는 경우에만 제공됨)
(typedef)
uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
각각 최소 8, 16, 32, 64비트 너비를 갖는 가장 빠른 부호 없는 정수형
(typedef)
uint_least8_t uint_least16_t uint_least32_t uint_least64_t
각각 최소 8, 16, 32, 64비트 너비를 갖는 가장 작은 부호 없는 정수형
(typedef)
uintmax_t
최대 너비 부호 없는 정수형
(typedef)
uintptr_t
(optional)
void 포인터를 담을 수 있는 부호 없는 정수형 void
(typedef)

매크로

부호 있는 정수 : 최솟값
INT8_MIN INT16_MIN INT32_MIN INT64_MIN
(optional)
각각 std::int8_t , std::int16_t , std::int32_t std::int64_t 의 최소값
(매크로 상수)
INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN
각각 std::int_fast8_t , std::int_fast16_t , std::int_fast32_t std::int_fast64_t 의 최소값
(매크로 상수)
INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN
각각 std::int_least8_t , std::int_least16_t , std::int_least32_t , std::int_least64_t 의 최솟값
(매크로 상수)
INTPTR_MIN
(optional)
std::intptr_t 의 최소값
(매크로 상수)
INTMAX_MIN
std::intmax_t 의 최솟값
(매크로 상수)
부호 있는 정수 : 최댓값
INT8_MAX INT16_MAX INT32_MAX INT64_MAX
(선택적)
각각 std::int8_t , std::int16_t , std::int32_t std::int64_t 의 최댓값
(매크로 상수)
INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX
각각 std::int_fast8_t , std::int_fast16_t , std::int_fast32_t std::int_fast64_t 의 최댓값
(매크로 상수)
INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX
각각 std::int_least8_t , std::int_least16_t , std::int_least32_t , std::int_least64_t 의 최댓값
(매크로 상수)
INTPTR_MAX
(optional)
std::intptr_t 의 최댓값
(매크로 상수)
INTMAX_MAX
std::intmax_t 의 최댓값
(매크로 상수)
부호 없는 정수 : 최댓값
UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX
(선택적)
각각 std::uint8_t , std::uint16_t , std::uint32_t std::uint64_t 의 최댓값
(매크로 상수)
UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX
각각 std::uint_fast8_t , std::uint_fast16_t , std::uint_fast32_t std::uint_fast64_t 의 최댓값
(매크로 상수)
UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX
각각 std::uint_least8_t , std::uint_least16_t , std::uint_least32_t std::uint_least64_t 의 최댓값
(매크로 상수)
UINTPTR_MAX
(optional)
std::uintptr_t의 최댓값 std::uintptr_t
(매크로 상수)
UINTMAX_MAX
std::uintmax_t 의 최댓값
(매크로 상수)
다른 정수형의 한계
PTRDIFF_MIN
(C++11)
std::ptrdiff_t의 std::ptrdiff_t 최소값
(매크로 상수)
PTRDIFF_MAX
(C++11)
std::ptrdiff_t 의 최댓값
(매크로 상수)
SIZE_MAX
(C++11)
std::size_t 의 최댓값
(매크로 상수)
SIG_ATOMIC_MIN
(C++11)
std::sig_atomic_t 의 최솟값
(매크로 상수)
SIG_ATOMIC_MAX
(C++11)
std::sig_atomic_t의 최댓값 std::sig_atomic_t
(매크로 상수)
WCHAR_MIN
(C++11)
wchar_t 의 최소값
(매크로 상수)
WCHAR_MAX
(C++11)
wchar_t 의 최댓값
(매크로 상수)
WINT_MIN
(C++11)
std::wint_t 의 최소값
(매크로 상수)
WINT_MAX
(C++11)
std::wint_t 의 최댓값
(매크로 상수)
정수 상수를 위한 함수 매크로
INT8_C INT16_C INT32_C INT64_C
인수로 지정된 값을 가지며, 그 타입이 각각 std::int_least8_t , std::int_least16_t , std::int_least32_t , std::int_least64_t 승격된 타입인 정수 상수 표현식으로 확장됨
(함수 매크로)
INTMAX_C
지정된 인자의 값을 가지며 std::intmax_t 타입을 갖는 정수 상수 표현식으로 확장됩니다
(함수 매크로)
UINT8_C UINT16_C UINT32_C UINT64_C
지정된 인자의 값을 가지며, 그 타입이 각각 승격된 std::uint_least8_t , std::uint_least16_t , std::uint_least32_t std::uint_least64_t 타입인 정수 상수 표현식으로 확장됨
(함수 매크로)
UINTMAX_C
지정된 인자의 값을 가지며 std::uintmax_t 타입인 정수 상수 표현식으로 확장됩니다
(함수 매크로)

시놉시스

namespace std {
  using int8_t         = /* 부호 있는 정수 타입 */;   // 선택적
  using int16_t        = /* 부호 있는 정수 타입 */;   // 선택적
  using int32_t        = /* 부호 있는 정수 타입 */;   // 선택적
  using int64_t        = /* 부호 있는 정수 타입 */;   // 선택적
  using intN_t         = /* 설명 참조 */;       // 선택적, 설명 참조
  using int_fast8_t    = /* 부호 있는 정수 타입 */;
  using int_fast16_t   = /* 부호 있는 정수 타입 */;
  using int_fast32_t   = /* 부호 있는 정수 타입 */;
  using int_fast64_t   = /* 부호 있는 정수 타입 */;
  using int_fastN_t    = /* 설명 참조 */;       // 선택적, 설명 참조
  using int_least8_t   = /* 부호 있는 정수 타입 */;
  using int_least16_t  = /* 부호 있는 정수 타입 */;
  using int_least32_t  = /* 부호 있는 정수 타입 */;
  using int_least64_t  = /* 부호 있는 정수 타입 */;
  using int_leastN_t   = /* 설명 참조 */;       // 선택적, 설명 참조
  using intmax_t       = /* 부호 있는 정수 타입 */;
  using intptr_t       = /* 부호 있는 정수 타입 */;   // 선택적
  using uint8_t        = /* 부호 없는 정수 타입 */; // 선택적
  using uint16_t       = /* 부호 없는 정수 타입 */; // 선택적
  using uint32_t       = /* 부호 없는 정수 타입 */; // 선택적
  using uint64_t       = /* 부호 없는 정수 타입 */; // 선택적
  using uintN_t        = /* 설명 참조 */;       // 선택적, 설명 참조
  using uint_fast8_t   = /* 부호 없는 정수 타입 */;
  using uint_fast16_t  = /* 부호 없는 정수 타입 */;
  using uint_fast32_t  = /* 부호 없는 정수 타입 */;
  using uint_fast64_t  = /* 부호 없는 정수 타입 */;
  using uint_fastN_t   = /* 설명 참조 */;       // 선택적, 설명 참조
  using uint_least8_t  = /* 부호 없는 정수 타입 */;
  using uint_least16_t = /* 부호 없는 정수 타입 */;
  using uint_least32_t = /* 부호 없는 정수 타입 */;
  using uint_least64_t = /* 부호 없는 정수 타입 */;
  using uint_leastN_t  = /* 설명 참조 */;       // 선택적, 설명 참조
  using uintmax_t      = /* 부호 없는 정수 타입 */;
  using uintptr_t      = /* 부호 없는 정수 타입 */; // 선택적
}
#define INTN_MIN         /* 설명 참조 */
#define INTN_MAX         /* 설명 참조 */
#define UINTN_MAX        /* 설명 참조 */
#define INT_FASTN_MIN    /* 설명 참조 */
#define INT_FASTN_MAX    /* 설명 참조 */
#define UINT_FASTN_MAX   /* 설명 참조 */
#define INT_LEASTN_MIN   /* 설명 참조 */
#define INT_LEASTN_MAX   /* 설명 참조 */
#define UINT_LEASTN_MAX  /* 설명 참조 */
#define INTMAX_MIN       /* 설명 참조 */
#define INTMAX_MAX       /* 설명 참조 */
#define UINTMAX_MAX      /* 설명 참조 */
#define INTPTR_MIN       /* 설명 참조 */        // 선택적
#define INTPTR_MAX       /* 설명 참조 */        // 선택적
#define UINTPTR_MAX      /* 설명 참조 */        // 선택적
#define PTRDIFF_MIN      /* 설명 참조 */
#define PTRDIFF_MAX      /* 설명 참조 */
#define SIZE_MAX         /* 설명 참조 */
#define SIG_ATOMIC_MIN   /* 설명 참조 */
#define SIG_ATOMIC_MAX   /* 설명 참조 */
#define WCHAR_MIN        /* 설명 참조 */
#define WCHAR_MAX        /* 설명 참조 */
#define WINT_MIN         /* 설명 참조 */
#define WINT_MAX         /* 설명 참조 */
#define INTN_C(value)    /* 설명 참조 */
#define UINTN_C(value)   /* 설명 참조 */
#define INTMAX_C(value)  /* 설명 참조 */
#define UINTMAX_C(value) /* 설명 참조 */