C: What is the difference between ++i and i++?

前端 未结 21 2072
伪装坚强ぢ
伪装坚强ぢ 2020-11-21 06:04

In C, what is the difference between using ++i and i++, and which should be used in the incrementation block of a for loop?

21条回答
  •  一向
    一向 (楼主)
    2020-11-21 06:07

    Please don't worry about the "efficiency" (speed, really) of which one is faster. We have compilers these days that take care of these things. Use whichever one makes sense to use, based on which more clearly shows your intent.

提交回复
热议问题