我有一个关于C语言标准中的数据类型提升规则的查询.C99说:
C整数提升还要求"如果int可以表示原始类型的所有值,则该值将转换为int;否则,它将转换为unsigned int".
我的问题是在C语言表达式的位置unsigned int和signed int存在的情况下,哪种类型将被提升为什么类型?
unsigned int
signed int
例如int,不能代表unsigned int(值大于MAX_INT值)的所有值,而unsigned int不能代表-ve值,那么在这种情况下什么类型被提升为什么?
int
MAX_INT
c integer-promotion
c ×1
integer-promotion ×1