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 scope in c++ with example?

628


Write a program to find the reverse Fibonacci series starting from N.

604


Who created c++?

577


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

538


Can we use struct in c++?

593






Which should be more useful: the protected and public virtuals?

602


When does a name clash occur in c++?

712


What parameter does the constructor to an ofstream object take?

609


Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.

609


Can we use this pointer in a class specific, operator-overloading function for new operator?

611


Array base access faster or pointer base access is faster?

1815


Why ctype h is used in c++?

523


When can I use a forward declaration?

624


What is a literal in c++?

566


What is flag in computer?

602