int a=30,b=1, c=5, i=10;
i=b<a<c;
i=b<a<c
is interpreted as:
- compute (b<a)
- compare the result to see if it is < c
- place that result into the variable i
So this is what happens:
- b<a is evaluated as 1<30, which is true, so the result is 1 .
- next this 1 result is compared to c, which is evaluated as 1< 5, which is also true, so that result is also 1
- this final 1 result is set as the value in the variable i.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…