Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!mcvax!ukc!reading!cf-cm!cybaswan!iiitsh From: iiitsh@cybaswan.UUCP (Steve Hosgood) Newsgroups: comp.std.c Subject: A question about the tertiary (? : ) operator Keywords: tertiary, lvalue, ternary Message-ID: <612@cybaswan.UUCP> Date: 18 Aug 89 14:54:49 GMT Organization: Institute for Industrial Information Technology Lines: 25 I never noticed until last night that the conditional operator: ? : ..is not a valid lvalue, even if both and are lvalues! I wanted to say: (flag > 0? foo: bar) = ; ..which didn't work, needless to say. I had to employ a temporary variable and an 'if' statement in the end :-(. Is there a good reason for this behaviour? Thanks in advance Steve -----------------------------------------------+------------------------------ Steve Hosgood BSc, | Phone (+44) 792 295213 Image Processing and Systems Engineer, | Fax (+44) 792 295532 Institute for Industrial Information Techology,| Telex 48149 Innovation Centre, University of Wales, | JANET: iiitsh@uk.ac.swan.pyr Swansea SA2 8PP | UUCP: ..!ukc!cybaswan!iiitsh -----------------------------------------------+------------------------------ My views are not necessarily those of my employers! Please note the change in my username as of 1 Aug '89