Logical Expressions in C misunderstanding

前端 未结 4 1505
不知归路
不知归路 2021-01-18 04:38

So, I was writing some code and I was getting an unexpected output in one part of my program which disrupted the entire system.

I managed to extract and simplify th

4条回答
  •  日久生厌
    2021-01-18 05:04

    ++i || ++j && k is evaluate to 1 (true) because i equals 2 (++1), (++j && k) isn't evaluated because short circuit.

提交回复
热议问题