Why preincrement operator is faster than postincrement?
Answer Posted / puneet nagpal
postincrement did not increment unless it find ; so it increments after the end of statement. while the preincrement operator increment before the end of statement. so preincrement operator is faster than postincrement operator.
ex- a=10;
a++;value incremented after the end of statement but
at this point value is 10.
a++;now the value is incremented to 11.
++a; preincrement incremented within the statement now
the value is 12.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do you remove an element from a set in c++?
What is a pointer how and when is it used?
write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.
What is the use of c++ programming language in real life?
What character terminates all character array strings a) b) . c) END
Is map thread safe c++?
Write syntax to define friend functions in C++.
Is c++ an integer?
What is bubble sort c++?
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
What is srand c++?
Explain about vectors in c ++?
What is the use of endl in c++ give an example?
What is #include sstream?
What are the various oops concepts in c++?