본문 바로가기
VisualStudio.C++.C#/코딩팁,함수활용,단편

Fixed width integer types C99표준. stdint.h 에 정의 있음. uint8_t, uint64_t 등.

by i.got.it 2020. 9. 7.


 

Fixed width integer types (since C99)

Types
Defined in header <stdint.h>
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
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일. 

댓글



 

비트코인




암호화폐       외환/나스닥/골드       암호화폐/외환/나스닥/골드 암호화폐/외환/나스닥/골드   암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)     롤오버 이자 없는 스왑프리계좌
( 스왑프리 암호화폐도 거래 가능 )    
MT4, MT5 , cTrader 모두 지원     FTMO 계좌 매매운용. MT4,MT5