Q: What does x++ mean?
A: x++ means the value of x , call this n , then set x as n + 1 , then return n .
Q: Why does this happen with non-variable?
A: Try to try something simple, say 3 and see where everything goes wrong.
Take the value 3 and name it n , okay, n = 3
Set 3 as n + 1 , so 3 = 3 + 1 , 3 = 4 it makes no sense! Therefore, if this step cannot be performed, the ++ operator cannot be used.
source share