v4vijayakumar wrote:
What is the difference between a variable and a modifiable lvalue?
A variable is independent named storage. An lvalue is basically just
storage that can appear on the left side of an assignment. So in these
cases:
x.y = 3; /* struct { int y; } x; */
q[i] = "Hello"; /* char * q[]; */
*(p + 3) = 7; /* int * p; */
*(f(3)) = 2; /* int * f(int); */
x.y, q[i], *(p+3) and *(f(3)) are all lvalues, but none are variables.
However, x, q and p are variables. f is a function, so there is no
variable at all involved there, nevertheless an assignment to an lvalue
does happen.
--
Paul Hsieh
http://www.pobox.com/~qed/ http://bstring.sf.net/