Data Type Ranges
형식 이름 |
바이트 |
바이트 |
기타 이름 |
값의 범위 |
---|---|---|---|---|
bool | 1 | 1 | TRUE / FALSE | |
char | 1 | 1 | –128 ~ 127 | |
unsigned char | 1 | 1 | 0 ~ 255 | |
short | 2 | 2 | short int, signed short int | –32,768 ~ 32,767 |
unsigned short | 2 | 2 | unsigned short int | 0 ~ 65,535 |
int | 4 | 4 | signed | –2,147,483,648 ~ 2,147,483,647 |
unsigned int | 4 | 4 | unsigned | 0 ~ 4,294,967,295 |
long | 4 | 4 | long int, signed long int | –2,147,483,648 ~ 2,147,483,647 |
unsigned long | 4 | 4 | unsigned long int | 0 ~ 4,294,967,295 |
long long | 8 | 8 | –9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 |
|
unsigned long long | 8 | 8 | 0 ~ 18,446,744,073,709,551,615 | |
float | 4 | 4 | 3.4E+/-38(7개의 자릿수) | |
double | 8 | 8 | 1.7E+/-308(15개의 자릿수) | |
long double | 8 | 16 | 1.7E+/-308(15개의 자릿수) | |
wchar_t | 2 | 2 | __wchar_t | 0 ~ 65,535 |
Data Models
모델 |
의미 |
적용 운영체제 |
---|---|---|
LP32 | 32비트: long, pointer 16비트: int |
Macintosh |
ILP32 | 64비트: long long 32비트: int, long, pointer |
Windows (x86) |
LP64 | 64비트: long, pointer 32비트: 그 외 |
Most Unix and Unix-like systems (x64) Solaris, Linux, BSD, MacOS X, Windows(when using Cygwin) |
ILP64 | 64비트: int, long, pointer 32비트: 그 외 |
HAL Computer Systems port of Solaris to the SPARC64 |
LLP64 | 64비트: long long, pointer 32비트: 그 외 |
Windows (x64) |
Windows String Types
형식 이름 |
의미 |
해당 자료형 |
---|---|---|
LPSTR | long pointer string | char * |
LPCSTR | long pointer constant string | const char * |
LPWSTR | long pointer wide string | wchar_t * |
LPCWSTR | long pointer constant wide string | const wchar_t * |
LPTSTR | long pointer t_string | tchar * |
LPCTSTR | long pointer constant t_string | const tchar * |
References
- [MSDN] Data Type Ranges
- [MSDN] Windows Data Types
- LPSTR, LPCSTR, LPTSTR, LPCTSTR , LPWSTR, LPCWSTR 의 의미
- [StackOverflow] What is the bit size of long on 64-bit Windows?
- [MSDN] Why did the Win64 team choose the LLP64 model?
- 32 / 64비트 환경에서 C/C++ 기본형의 크기