一个C语言的小问题
U8 Hello
Hello=28 < <3+1;
Hello 等于多少?
U8是无符号整型数
我编了程算了一下是192,这是为什么
[解决办法]
c语言的操作符共有15个优先级,如下:
Operators Associativity
() [] -> . left to right
! ~ ++ -- + - * (type) sizeof right to left
* / % left to right
+ - left to right
< < > > left to right
< <= > > = left to right
== != left to right
& left to right
^ left to right
| left to right
&& left to right
|| left to right
?: right to left
= += -= *= /= %= &= ^= |= < <= > > = right to left
, left to right
优先级从上到下依次递减,最上面具有最高的优先级,逗号操作符具有最低的优先级。
所有的优先级中,只有三个优先级是从右至左结合的,它们是单目运算符、条件运算符、赋值运算符。其它的都是从左至右结合。