我新手,c语言关系运算符和赋值运算符,哪个优先级高?比如a=b>c怎么理解?

2024-11-11 05:28:41
推荐回答(1个)
回答1:

下面的是优先级排序上面的高下面的低,左右高低有描述。
() [] -> . 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
========================
a=b>c 相当于 a = (b> c)