comp.lang.c
[Top] [All Lists]

Re: ?: as an lvalue

Subject: Re: ?: as an lvalue
From: Ben Bacarisse
Date: Mon, 31 Mar 2008 19:19:04 +0100
Newsgroups: comp.lang.c

Richard <devr_@xxxxxxxxx> writes:

> "Bartc" <bc@xxxxxxxxxx> writes:
<snip>
>> Exactly why a?b:c can't appear like that on the left-hand-side of an 
>> assignment is a bit of a mystery; 
>
> There is no mystery about it.

Why not help by explaining it then?  It is a mystery to me as well, so
least least two people would benefit from your explanation.

In particular, a Closely Related Language, *does* allow the result of
a conditional operator to be an lvalue.  I can't think, off-hand, of a
reason for this difference.

-- 
Ben.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy