C基礎:if else

else if 相匹配規則

The rule is that an else goes with the most recent if unless braces indicate otherwise

&& || !Precedence

The ! operator has a very high precedence—higher than multiplication, the same as the

increment operators, and just below that of parentheses. The && operator has higher

precedence than ||, and both rank below the relational operators and above assignment in

precedence. Therefore, the expression

a > b && b > c || b > d

would be interpreted as

((a > b) && (b > c)) || (b > d)


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章