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


Please Help Members By Posting Answers For Below Questions

Why c++ is called oop?

827


What are advantages of c++?

764


Search for: what is pair in c++?

849


How is computer programming useful in real life?

766


Why do we need templates?

725






What is using namespace std in cpp?

739


What is the keyword auto for?

770


Why is c++ not purely object oriented?

747


What is the fastest c++ compiler?

751


Is java easier than c++?

768


What is a c++ map?

914


Why iomanip is used in c++?

833


Define upcasting.

783


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

992


What are the various situations where a copy constructor is invoked?

808