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 c++ is called oop?
What are advantages of c++?
Search for: what is pair in c++?
How is computer programming useful in real life?
Why do we need templates?
What is using namespace std in cpp?
What is the keyword auto for?
Why is c++ not purely object oriented?
What is the fastest c++ compiler?
Is java easier than c++?
What is a c++ map?
Why iomanip is used in c++?
Define upcasting.
What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number
What are the various situations where a copy constructor is invoked?