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

Where the memory to the static variables is allocated?

558


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1077


What are the rules for naming an identifier?

561


What is the difference between prefix and postfix versions of operator++()?

591


List the advantages of inheritance.

640






What does ios :: app do in c++?

551


What is a namespace in c++?

596


How do you compile the source code with your compiler?

615


Explain linked list using c++ with an example?

631


Difference between pass by value and pass by reference?

597


Is ca high or low level language?

583


Explain stack unwinding.

633


Describe the role of the c++ in the tradeoff of safety vs. Usability?

711


What are move semantics?

673


How would you use the functions memcpy(), memset(), memmove()?

624