|
-
August 28th, 2003, 05:37 AM
#1
Is this true.. ++i better than i++
Postfix increment and decrement operators create a temporary object when used while prefix operators don’t.
It is therefore more efficient to use the prefix version where possible, particularly in for loop constructs as whatever is used will be called multiple times in that case, i.e.,
we should use:
for (int nType = 0; nType < MM_NUM_TYPES; ++nType)
{
…
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|