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
What is called array?
Do vectors start at 0?
What is a linked list in c++?
What is protected inheritance?
What is bubble sort c++?
What is an arraylist c++?
Explain differences between alloc() and free()?
Explain "const" reference arguments in function?
What apps are written in c++?
If a header file is included twice by mistake in the program, will it give any error?
What is the benefit of c++?
Explain container class.
What do the keywords volatile and mean mutable?
What is c++ stringstream?
What is the difference between a definition and a declaration?