Why when using XOR in an even number loop condition, it's executed exactly this even number of times

前端 未结 0 343
日久生厌
日久生厌 2020-12-04 22:06

Why when n is even, such for loops execute exactly n iterations:

for (int i = 0; i ^= n; i++){//body}

for         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题