Is there a performance difference between i++ and ++i in C?

前端 未结 14 1083
遥遥无期
遥遥无期 2020-11-22 10:08

Is there a performance difference between i++ and ++i if the resulting value is not used?

14条回答
  •  礼貌的吻别
    2020-11-22 10:47

    Please don't let the question of "which one is faster" be the deciding factor of which to use. Chances are you're never going to care that much, and besides, programmer reading time is far more expensive than machine time.

    Use whichever makes most sense to the human reading the code.

提交回复
热议问题