Why preincrement operator is faster than postincrement?

Answer Posted / ranjeet garodia

Pre increment operator is use the concept of value by
reference that means it increment the actual object.

While post increment use call by value concept that is it
create the local object, operate on that, then it will
increment actual object, so takes time to create local
object

Is This Answer Correct ?    10 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the main purpose of overloading operators?

582


What are c++ templates used for?

607


When do we run a shell in the unix system?

555


How a macro differs from a template?

629


What is dynamic and static typing?

662






Name the operators that cannot be overloaded in C++?

578


Can a class be static in c++?

561


What does return 0 do in c++?

572


What is the main use of c++?

541


What is the use of default constructor?

563


What does asterisk mean in c++?

576


What is a tree in c++?

557


Describe public access specifiers?

573


Differentiate between a template class and class template in c++?

622


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

607