August 28th, 2003, 06:37 AM
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)
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.