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

前端 未结 9 1722
难免孤独
难免孤独 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条回答
  •  北恋
    北恋 (楼主)
    2021-01-26 05:12

    All sensible compilers should compile equivalent loops to identical assembly / IL code involving branches and jumps. (at least with optimizations enabled)

提交回复
热议问题