Feedback lvalue vs rvalue 

Forum: U Chicago, Com Sci 221, autumn 2000
Re: News Take-home midterm exam, due 6 November (Mike O'Donnell)
Re: Question About the last problem in the Mid-term (Zhenglong Gu)
Date: 2000, Nov 08
From: Jake Bartolone jbbartol

Let put things easier. If we do assignment like x = y. I know we should put r(y) in l(x), as we discussed in the class. But if we want to do *x = y. There are two possible ways to do this: put r(y) in the l(*x) or put l(y) in the l(x) Somebody help me out why the second is wrong:(


It's my understanding that you can't put l(y) into l(x) because you can't store an lvalue directly into another location. You can store an rvalue, however, so you need to get r(y). I'm not sure why you want to store the value in l(x) in the second case instead of in l(*x) though.

Having *x on the left side of the assignment means that you want to store the rvalue of y in the lvalue which is the rvalue of x. I think.

I found a webpage that has a decent demonstration on the meaning of dereferencing, but I am not at home. I will post it in a couple of hours if you want to look there. I didn't really get it until I looked at their explanation.


Jake Bartolone


Messages

1. None Re: lvalue vs rvalue by Sam TH, 2000, Nov 08
2. None I am not convinced by Zhenglong Gu, 2000, Nov 08
1. More think about what a pointer means?? by Michael C. Brizic, 2000, Nov 08
2. Disagree You didn't understand me by Torkiat Krutpum, 2000, Nov 09

to: "lvalue vs rvalue"