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

Re: ?: as an lvalue

Subject: Re: ?: as an lvalue
From: Richard
Date: Mon, 31 Mar 2008 20:47:27 +0200
Newsgroups: comp.lang.c

Ben Bacarisse <ben.usenet@xxxxxxxxx> writes:

> 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.

Huh? I must be missing something here or I will be first to apologise.

We already know that

*(c?x:y)=v;

is ok where x and y are pointers.

But (c?x:y)=v;

I dont really know what to say. 

>
> 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.

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