8. Casting
to convert a value into other type
(type)variable
type(variable)
Safe
It’s safe to convert small size type into large size type
- Integer to Integer(Promotion)
- Integer to Floating point number
9. Casting
Unsafe(narrowing)
It’s not safe to convert large size type into small size type
- Integer to Integer
- Signed to Unsigned
- Floating point number to Integer
to convert a value into other type
(type)variable
type(variable)
10. printf( ), scanf( )
int printf("형식 문자열", 변수)
int scanf("형식 문자열", &변수)
100
Value
0x53AB97FB
14. printf( ), scanf( )
int printf("형식 문자열", 변수)
int scanf("형식 문자열", &변수)
- 성공 시 출력된 문자 수만큼 반환
- 실패 시 음수 반환
printf( )
- 성공 시 성공적으로 입력 받은 수를 반환
- 실패 시 EOF 반환
scanf( )