Type Casting
Casting의 종류는 크게 2가지로 나눌수 있다. - implicit cast (compiler가 자동으로 type을 변경)- explicit cast (programer가 type 변경) * implicit cast(묵시적 변환)- numeric promotiontype casting시 더 높은 자료형의 값으로 변경ex) double dValue = 1.3f ; (float -> double) - numeric conversion서로 다른 type의 변환 (type이 달라 해당 data의 값이 손실이 될 수 있음) ex) int nValue = 3.4; (3.4 -> 3으로 변경 / data 손실 발생)char ch = 355; (char data value range : -128 ~ 127 / 35..
개발/C++
2020. 12. 30. 13:34