C中的无符号十六进制常量? [英] Unsigned hexadecimal constant in C?
本文介绍了C中的无符号十六进制常量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
C 是否处理十六进制常量(例如 0x23FE)和有符号或无符号整数?
Does C treat hexadecimal constants (e.g. 0x23FE) and signed or unsigned int?
推荐答案
数字本身总是被解释为非负数.十六进制常量没有符号或任何固有的方式来表示负数.常量的类型是其中第一个可以表示其值的类型:
The number itself is always interpreted as a non-negative number. Hexadecimal constants don't have a sign or any inherent way to express a negative number. The type of the constant is the first one of these which can represent their value:
int
unsigned int
long int
unsigned long int
long long int
unsigned long long int
这篇关于C中的无符号十六进制常量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文