Why preincrement operator is faster than postincrement?

Answer Posted / shakti singh khinchi

Because post increment operator uses a temporary variable to
store the incremented value for a variable until it is used
in the next executed statement, whereas pre increment
operator not using any temp variable, it is just increase
that value at the time of execution using reference.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is format for defining a structure?

790


What are advantages of c++?

764


Is there a c++ certification?

774


What is the advantage of an external iterator.

740


Const char *p , char const *p What is the difference between the above two?

885






Which programming language should I learn first?

746


Difference between pass by value and pass by reference?

815


What is the best c++ book for beginners?

795


Explain the virtual inheritance in c++.

790


Can I create my own functions in c++?

788


Can comments be nested?

794


What are structures and unions?

761


What is the purpose of templates in c++?

749


What are advantages of using friend classes?

811


What is scope in c++ with example?

819