Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!uunet!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: cond. op. on ='s LHS Message-ID: <5669:Feb2020:23:4791@kramden.acf.nyu.edu> Date: 20 Feb 91 20:23:47 GMT References: <331@smds.UUCP> <1210@sheol.UUCP> <335@ptcburp.ptcbu.oz.au> Organization: IR Lines: 19 In article <335@ptcburp.ptcbu.oz.au> michi@ptcburp.ptcbu.oz.au (Michael Henning) writes: > int array[10][10]; > *array > The type of the expression after dereferencing is "array of 10 ints", which > is *not* an lvalue. Either (1) array types are never lvalues, or (2) array types can never be assigned to even if they are lvalues. I don't know which way the standard defines lvalues; I find (2) a simpler approach, but in any case (1) and (2) produce the same results. None of this is relevant to the question at hand, which is whether *(cond ? &a : &b) = x is valid. It is, provided that a = x and b = x are valid. It will work under any sane compiler. It must work under an ANSI compiler. ---Dan