Fixed width integer types (since C99)
Types
| Defined in header <stdint.h> | |
int8_tint16_tint32_tint64_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_tint_fast16_tint_fast32_tint_fast64_t | fastest signed integer type with width of at least 8, 16, 32 and 64 bits respectively |
int_least8_tint_least16_tint_least32_tint_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_tuint16_tuint32_tuint64_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_tuint_fast16_tuint_fast32_tuint_fast64_t | fastest unsigned integer type with width of at least 8, 16, 32 and 64 bits respectively |
uint_least8_tuint_least16_tuint_least32_tuint_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 VC++ 64비트 컴파일러에서는 uintptr_t 는 uint64_t 와 동일함. |
uintptr_t | unsigned integer type capable of holding a pointer. 참고. VC++ 64비트 컴파일러에서는 uintptr_t 는 uint64_t 와 동일함. |
자료형 정의 중에 uintmax_t 와 uintptr_t 는 VC++ 64비트 컴파일러에서는 uint64_t 와 동일한 것이다.
표준자료형으로써 변수의 사이즈 혼선없이 자료형 정의할 목적으로 표준정수형을 사용하려는 것인데 플랫폼에 따라 사이즈 혼선 일으킬 가능성 있는 uintmax_t , uintptr_t 같은건 코드에서 사용하지 말자. 코드에서는 항상 명시적이고 표준적인것을 활용해야 지속가능하면서도 정신건강 해치지 않는 발전적인 행복 코딩 가능하다.
from http://en.cppreference.com/w/c/types/integer
Visual Studio 2010 버전 이후의 Visual C++ 에서도 위 자료형 선언가능하며, stdint.h 를 include 하면 됨.
본 글 포함된 상위 정리글.
Visual Studio/VC++/C/C# 활용정리 -> http://igotit.tistory.com/11
|
단축 : https://igotit.tistory.com/516
첫 : 2015년 12월 24일.
최종 : 2020년 9월 7일.
'VisualStudio.C++.C# > 코딩팁,함수활용,단편' 카테고리의 다른 글
| Visual C++ 2019 . WebSocket 구현 골격. cpprestsdk 기반. (0) | 2020.09.09 |
|---|---|
| std::function<R(Args...)>::target (0) | 2020.09.08 |
| win API . FindWindow , FindWindowEx (0) | 2020.09.05 |
| MFC.대화상자. x버튼 그레이처리 (1) | 2020.08.31 |
| WM_COPYDATA . OnCopyData . CWnd * pWnd . WPARAM (0) | 2020.08.31 |
댓글