Why preincrement operator is faster than postincrement?
Answer Posted / puneet nagpal
postincrement did not increment unless it find ; so it increments after the end of statement. while the preincrement operator increment before the end of statement. so preincrement operator is faster than postincrement operator.
ex- a=10;
a++;value incremented after the end of statement but
at this point value is 10.
a++;now the value is incremented to 11.
++a; preincrement incremented within the statement now
the value is 12.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why cstdlib is used in c++?
If a base class is an adt, and it has three pure virtual functions, how many of these functions must be overridden in its derived classes?
What is c++ map?
what does the following statement mean? int (*a)[4]
Why Pointers are not used in C++?
What is one dimensional array in c++?
How to defines the function in c++?
What is type of 'this' pointer?
Does dev c++ support c++ 11?
Explain class invariant.
Do you know what are static and dynamic type checking?
When does a name clash occur in c++?
What is the use of dot in c++?
what is the use of void main() in C++ language?
What is the best free c++ compiler for windows?