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
Does c++ have string data type?
What is a local variable?
What are the effects after calling the delete this operator ?
What does namespace mean in c++?
What are the various oops concepts in c++?
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
What is data abstraction? How is it different from data encapsulation?
Can we declare a base-class destructor as virtual?
What is a storage class?
What is constructor and destructor in c++?
What is lazy initialization in c++?
What is a container class? What are the types of container classes in c++?
How are the features of c++ different from c?
When should I use unitbuf flag?
What are the classes in c++?