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

Re: ?: as an lvalue

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

lawrence.jones@xxxxxxxxxxx writes:

> Bartc <bc@xxxxxxxxxx> wrote:
>> 
>> Exactly why a?b:c can't appear like that on the left-hand-side of an 
>> assignment is a bit of a mystery; after all a, a.b, a->b, a[b] and so on can 
>> all appear on the lhs without the programmer having to insert explicit 
>> address-of operators.
>
> Because b and c are two distinct objects that can have different types,
> which makes the type of any resulting lvalue somewhat problematic.
>
> -Larry Jones

That should nail it ...

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