구분 | 자료형 | 크기 | 범위 |
---|---|---|---|
기본형 | void | – | – |
문자형 | char | 1 byte | 0 ~ 127 |
(signed) char | -128 ~ 127 | ||
unsigned char | 0 ~ 255 | ||
wchar_t | 2 byte | 0 ~ 65,535 | |
정수형 | bool | 1 byte | 0 ~ 1 |
(signed) short (int) | 2 byte | -32,768 ~ 32,767 | |
unsigned short (int) | 0 ~ 65,535 | ||
(signed) int | 16bit : 2 byte 32/64bit : 4 byte |
-2,147,483,648 ~ 2,147,483,647 | |
unsigned int | 0 ~ 4,294,967,295 | ||
(signed) long (int) | ~32bit : 4 byte 64bit : 8 byte |
-2,147,483,648 ~ 2,147,483,647 | |
unsigned long (int) | 0 ~ 4,294,967,295 | ||
실수형 | float | 4 byte | 3.4E-38(-3.4*10^38) ~ 3.4E+38(3.4*10^38) (7digits) |
(long) double | 8 byte | 1.79E-308(-1.79*10^308) ~ 1.79E+308(1.79*10^308) (15digits) |