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

What is the advantage of c++ over c?

735


What is the disadvantage of using a macro?

780


What is the basic concept of c++?

728


Can manipulators fall in love?

732


What is the difference between map and hashmap in c++?

760






Is c++ slower than c?

768


What is this weird colon-member (" : ") syntax in the constructor?

728


What is the difference between multiple and multilevel inheritance in c++?

832


What is main function in c++ with example?

777


What is an overflow error?

810


Describe linkages and types of linkages?

757


What is the difference between structure and class?

775


What is a forward referencing and when should it be used?

805


What is class invariant in c++?

935


Write a code/algo to find the frequency of each element in an array?

807