Increment operators | SoloLearn: Learn to code for FREE!

0

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

Ibrahim

2 Answers

New Answer

+7

https://www.sololearn.com/Discuss/407846/?ref=app

0

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.