In i++ , the value of i changes. After execution, the value of i is equal to one plus its previous value. However, you cannot save the value in w+x , and therefore you cannot perform one of the following actions, which all (if they work) will have more or less the same effect:
w+x = w+x+1; w+x += 1; (w+x)++;
Something that can be placed on the left side of a job is usually called an lvalue (l for the left). In short, this means that ++ can only be applied to lvalues, and w+x not an lvalue. You can learn more about lvalues ββ(and other meanings) in this question and its answers:
- What are rvalues, lvalues, xvalues, glvalues ββand prvalues?
Joshua taylor
source share