Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > variable - modifiable lvalue

Reply
Thread Tools

variable - modifiable lvalue

 
 
v4vijayakumar
Guest
Posts: n/a
 
      05-15-2006
What is the difference between a variable and a modifiable lvalue?
TIA.

 
Reply With Quote
 
 
 
 
websnarf@gmail.com
Guest
Posts: n/a
 
      05-15-2006
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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lvalue -modifiable and non-modifiable Kavya C Programming 3 11-06-2006 10:33 PM
Re: Why is this not a modifiable lvalue. Dan Pop C Programming 6 06-30-2003 02:19 PM
Re: Why is this not a modifiable lvalue. Micah Cowan C Programming 1 06-28-2003 06:05 PM
Re: Why is this not a modifiable lvalue. Martin Ambuhl C Programming 0 06-27-2003 06:17 PM
Re: Why is this not a modifiable lvalue. Simon Biber C Programming 0 06-27-2003 11:12 AM



Advertisments