Increment operators | SoloLearn: Learn to code for FREE!


Increment operators

What is the difference between the prefix and postfix increment operators it's really confusing when used in a code. What would be delighted output of this code. int a= 5; int b= 4; b= a++; cout << b;

7/27/2017 11:46:34 AM


2 Answers

New Answer



Prefix: makes increment, return you original object Postfix: makes copy with old value, increments value, returns you old copy. In statements returned values are used.