int main() {
int i = -3, j = 2, k = 0, m;
m = ++i || ++j && ++k;
printf("%d %d %d %d
", i, j, k, m);
return 0;
}
i thought that && has more precedence that || as per this logic ++j
should execute, but it never does and the program outputs -2 2 0 1
. What is going on here? What are the intermediate steps?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…