Google News
logo
Embedded C - Interview Questions
Why is the statement ++i faster than i+1?
* ++i instruction uses single machine instruction like INR (Increment Register) to perform the increment.

* For the instruction i+1, it requires to load the value of the variable i and then perform the INR operation on it. Due to the additional load, ++i is faster than the i+1 instruction.
Advertisement