Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!genrad!decvax!ima!cfisun!lakart!dg From: dg@lakart.UUCP (David Goodenough) Newsgroups: comp.lang.c Subject: Re: precedence of && (was: precedence of ?:) Message-ID: <688@lakart.UUCP> Date: 19 Sep 89 15:11:36 GMT References: <3263@solo5.cs.vu.nl> Organization: Lakart Corporation, Newton, MA Lines: 37 OK, you say: a ? b : c = d can't be parsed sensibly as (a ? b : c) = d which I tend to agree with: the term in parentheses is not an lvalue. But what about: int a; char *b, *c, d; . . . a ? *b : *c = d Now, can that legally be done?? Whatever value a has (TRUE or FALSE) the a ? *b : *c construct could be considered an lvalue (OK, so you need a slightly twisted mind to see it :-) ) And it's a somewhat academic question, since the * (indirection) operator distributes over the ?: operator: the above could equally well be written as: *(a ? b : c) = d which had better be fair game, otherwise I'm going to complaing to my compiler vendor. -- dg@lakart.UUCP - David Goodenough +---+ IHS | +-+-+ ....... !harvard!xait!lakart!dg +-+-+ | AKA: dg%lakart.uucp@xait.xerox.com +---+