None Re: 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)
Re: Feedback lvalue vs rvalue (Jake Bartolone)
Date: 2000, Nov 08
From: Sam TH <sam@uchicago.edu>

On Wed, Nov 08, 2000 at 03:53:35PM -0600, Jake Bartolone wrote:
> 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.

Actually, you could put l(y) into l(x) - not that you ever should:

try this - I haven't tested it, but it should work:

int ** z; z = &x; *z = (int **)y;

Not that is is horrible, ugly, and should be prohibited by anyting with more type checking than assembly - which is why C allows it. :-)


Messages

to: "Re: lvalue vs rvalue"