Current location - Education and Training Encyclopedia - University ranking - A & Great God points out the meaning in brackets in the first point. & ampb is a
A & Great God points out the meaning in brackets in the first point. & ampb is a
C language uses 0 to indicate logic false, and non-0 indicates logic true.

&&is a logical AND operator. Only when both sides are logically true, the result is logically true.

For a&; & expression b, if a is logical false (0), you can determine that the value of the whole expression is logical false without calculating the value of b (it is true at the same time, and the result is true; One is false and the result is false.

This is an optimization of the compiler. Only when a is logically true (non-zero) can the value of b be calculated. This is the meaning of the sentence in brackets.