Put simply, an lvalue is something that can appear on the left-hand side of an assignment, typically a variable or array element.
So if you define int *p
, then p
is an lvalue. p+1
, which is a valid expression, is not an lvalue.
If you're trying to add 1 to p
, the correct syntax is:
p = p + 1;