Re: returning lvalue in C vs C++



Ben C wrote:

f().x = 200;    /* "invalid lvalue" in C, but not in C++ apparently */

Consider the general scheme of C++, and specifically its overloaded
operators.

x.operator=() (figuratively) could have a side-effect that your code depends
on. So regardless where 'thing' appears, thing.x is accessible as an
lvalue.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
.