Home > Back-end >  The use of c language logical operators
The use of c language logical operators

Time:10-06

The 2 has been assigned to y, isn't it? How is 0

CodePudding user response:

https://zh.cppreference.com/w/c/language/operator_logical

CodePudding user response:

C the logic operation is short circuit operation, so y=2, no execution;

CodePudding user response:

& & : x=0, while in parentheses and x==1 at this time was not false, false, y=2 behind this statement is not performed, because & amp; & As long as there is a statement which is false, that this expression is false, is not to judge the statements on the right, so y is 0
  • Related