공부 C의 변환이 내가 잘 이해하지 않은 정수 프로모션에 대한 단락을 발견, 그것은 말한다 :이
을 :
"Integer types smaller than int are promoted when an operation is performed on them. If all values of the original type can be represented as an int, the value of the smaller type is converted to an int; otherwise, it is converted to an unsigned int"
가 고려 부호없는 정수 유형의 순위는 해당하는 부호있는 정수 유형의 순위와 같습니다.
long long int의 순위가 long int의 순위보다 큽니다.이 int의 순위는 short int의 순위보다 크므로 signed char의 순위보다 큽니다.
질문은 다음과 같습니다 왜 INT보다 작은 유형은 INT로 표현되어서는 안된다? 그리고 왜 unsigned int가 int가 나타내지 않아야하는 값을 나타낼 수 있습니까?
미리 감사드립니다.
왜 누군가가 int보다 짧은 것을 선호하는지 알아 내려고 노력하고 있습니까? – kevin628