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

Re: ?: as an lvalue

Subject: Re: ?: as an lvalue
From:
Date: Mon, 31 Mar 2008 15:58:06 -0400
Newsgroups: comp.lang.c

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

Please tell me I'm adopted. -- Calvin

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