for loop VS while loop in programming languages, c++/java?

前端 未结 9 1723
难免孤独
难免孤独 2021-01-26 04:59

Which is better for performance? This may not be consistent with other programming languages, so if they are different, or if you can answer my question with your knowledge in a

9条回答
  •  梦毁少年i
    2021-01-26 05:08

    It won't make any difference with compiler optimization!

    My 2cts, when it deals about loop implementation choice, it's important to use the one which suits the algorithm logic. It's easier to read the code.

提交回复
热议问题