Path: utzoo!attcan!utgpu!watmath!att!dptg!rutgers!cs.utexas.edu!uunet!yale!mfci!karzes From: karzes@mfci.UUCP (Tom Karzes) Newsgroups: comp.lang.c Subject: Re: precedence of && (was: precedence of ?:) Message-ID: <1038@m3.mfci.UUCP> Date: 21 Sep 89 18:05:05 GMT References: <3263@solo5.cs.vu.nl> <688@lakart.UUCP> Sender: karzes@mfci.UUCP Reply-To: karzes@mfci.UUCP (Tom Karzes) Organization: Multiflow Computer Inc., Branford Ct. 06405 Lines: 27 Neither of the following are legal because conditional expressions (?:) are not regarded as lvalues: (a ? b : c) = d (a ? *b : *c) = d However, the following is legal since indirection expressions (*) are legal lvalues: *(a ? b : c) = d I personally don't see why ?: expressions can't be lvalues, provided the second and third operands have the same type. For example, the following would be legal, with result type int: int a, b, c[10], d, i; ... (a ? b : c[i]) = d; But the following would be illegal: int a, b, d; double c; ... (a ? b : c) = d; Oh well...