정수: byte, short, int, and long
실수: float and double
문자: char
논리: boolean
Data Type Memory (bytes) Range Format Specifier
short int |
2 |
-32,768 to 32,767 |
%hd |
unsigned short int |
2 |
0 to 65,535 |
%hu |
unsigned int |
4 |
0 to 4,294,967,295 |
%u |
int |
4 |
-2,147,483,648 to 2,147,483,647 |
%d |
long int |
4 |
-2,147,483,648 to 2,147,483,647 |
%ld |
unsigned long int |
4 |
0 to 4,294,967,295 |
%lu |
long long int |
8 |
-(2^63) to (2^63)-1 |
%lld |
unsigned long long int |
8 |
0 to 18,446,744,073,709,551,615 |
%llu |
signed char |
1 |
-128 to 127 |
%c |
unsigned char |
1 |
0 to 255 |
%c |
float |
4 |
%f |
|
double |
8 |
%lf |
|
long double |
16 |
%Lf |
'<프로그래밍 언어> > [C 언어]' 카테고리의 다른 글
[C 언어] strlen 함수 (0) | 2022.02.28 |
---|---|
[C 언어] Syntactic Sugar 문법적 설탕 (0) | 2022.02.28 |
[C 언어] 탐욕 알고리즘 (Greedy algorithm) (0) | 2022.02.27 |
[C 언어] \n, escape sequence (0) | 2022.02.26 |
댓글