본문 바로가기
<프로그래밍 언어>/[C 언어]

[C 언어] Datatype in C: int float double char bool long string

by 자라나는 콩 2022. 2. 27.

정수: byte, short, int, and long

실수: float and double

문자: char

논리: boolean

                          Data Type                      Memory (bytes)                                      Range                                Format Specifier  

short int 
 

 
-32,768 to 32,767 
 
%hd 
 
unsigned short int 
 

 
0 to 65,535 
 
%hu 
 
unsigned int 
 

 
0 to 4,294,967,295 
 
%u 
 
int 
 

 
-2,147,483,648 to 2,147,483,647 
 
%d 
 
long int 
 

 
-2,147,483,648 to 2,147,483,647 
 
%ld 
 
unsigned long int 
 

 
0 to 4,294,967,295 
 
%lu 
 
long long int 
 

 
-(2^63) to (2^63)-1 
 
%lld 
 
unsigned long long int 
 

 
0 to 18,446,744,073,709,551,615 
 
%llu 
 
signed char 
 

 
-128 to 127 
 
%c 
 
unsigned char 
 

 
0 to 255 
 
%c 
 
float 
 

 
  %f 
 
double 
 

 
  %lf 
 
long double 
 
16 
 
  %Lf 
 

댓글