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
Which operator cannot be overloaded c++?
Which ide is best for c++?
What do you understand by a pure virtual member function?
Is it possible for a member function to use delete this?
What are the four partitions in which c++ compiler divides the ram?
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
How do you define/declare constants in c++?
What are the advantages of using const reference arguments in a function?
Define friend function.
Eplain extern keyword?
What is c++ good for?
What function initalizes variables in a class: a) Destructor b) Constitutor c) Constructor
Define linked lists with the help of an example.
What is the maximum combined length of command line arguments including the space between adjacent arguments?
total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.