0

Different between x++ and x=x++

What is the diffrent between x++ and x=x++ when x=1

2nd Jan 2017, 6:37 AM
Zahidul Islam
Zahidul Islam - avatar
2 Answers
0
No difference they are same, x++ increments by 1 after execution of statement however x=x++ increments after assignment of value. Since memory address (Lvalue) is same so they are same both ways.
2nd Jan 2017, 6:47 AM
Zahid Khan
Zahid Khan - avatar
- 1
x++ simply increments the value of x by 1. (value is not stored) x=x++ In this, the value is first incremented and assigned to itself which means the value is stored in the memory referenced by x.
2nd Jan 2017, 6:54 AM
Tahir Ahamed
Tahir Ahamed - avatar