Possible Duplicate:
Is there a performance difference between i++ and ++i in C++?
Is there a reason some programmers write ++i in a normal for loop instead of writing i++?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For integers, there is no difference between pre- and post-increment.
If
iis an object of a non-trivial class, then++iis generally preferred, because the object is modified and then evaluated, whereasi++modifies after evaluation, so requires a copy to be made.