상세 컨텐츠

본문 제목

변수 (C언어)

Tech/C

by 2020. 8. 5. 01:37

본문

Char는 문자를 저장한다.

signed(=부호가 있는)

ascii 코드 참조.

1byte (-128~127)

 

Int는 정수를 저장한다.

signed

4bytes (1 sign bit, 31 value bit)

가장 작은 정수 = 1 followed by 31 zeros

가장 큰 정수 = 0 followed by 31 ones

 

float는 실수

4bytes

 

double

8bytes

 

signed/unsigned

signed가 디폴트값

char과 int에 적용가능 --> unsinged char, unsigned int

 

long

long int --> 8bytes가 됨

 

long long

 

short

short int--> 2bytes가 됨