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
Write a program which uses Command Line Arguments
Show the declaration for a static member variable.
What does h mean in maths?
Explain how we implement exception handling in c++?
How can I learn dev c++ programming?
what are the iterator and generic algorithms.
How a new element can be added or pushed in a stack?
Which software is used for c++ programming?
How would you implement a substr() function that extracts a sub string from a given string?
What is basic if statement syntax?
Define pointers?
What is the use of register keyword with the variables?
What is the most common mistake on c++ and oo projects?
What is the difference between prefix and postfix versions of operator++()?
What are the various storage classes in C++?