Why preincrement operator is faster than postincrement?

Answer Posted / sanish joseph

the pre inc operator increments the value of that particular
variable on that line itself

the post inc operator increments the value of that
particular variable after going on the next line

in simple words

eg.

e=5; on this line value of e=5

e++; on this line value of e=5

++e; on this line value of e=7

Is This Answer Correct ?    27 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can virtual functions in c++ be implemented?

612


How to give an alternate name to a namespace?

593


Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?

563


what you know about c++?

668


How do you decide which integer type to use?

579






Define a nested class. Explain how it can be useful.

640


How is data hiding achieved in c++?

577


What does obj stand for?

635


How to tokenize a string in c++?

607


How the endl and setw manipulator works?

563


How do you invoke a base member function from a derived class in which you’ve overridden that function?

586


How do you clear a buffer in c++?

543


How can you quickly find the number of elements stored in a static array?

642


What are the two main components of c++?

592


What are the syntactic rules to be avoid ambiguity in multiple inheritance?

636