Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!crdgw1!underdog!volpe From: volpe@underdog.crd.ge.com (Christopher R Volpe) Newsgroups: comp.lang.c Subject: Comma operator: lvalue???? Message-ID: <10839@crdgw1.crd.ge.com> Date: 7 Aug 90 18:05:19 GMT Sender: news@crdgw1.crd.ge.com Reply-To: volpe@underdog.crd.ge.com (Christopher R Volpe) Lines: 24 Can someone with a copy of the standard tell me if the comma operator produces an lvalue. This is one of the only operators that K&R2 fails to mention whether or not it returns an lvalue. My intuition at first would tell me no, but the following works under GNU C: main() { int a,b; if (&a == &(a,b)) printf("I shouldn't see this\n"); if (&b == &(a,b)) printf(" Test 1: address-of works properly.\n"); (a,b)=4; if (b==4) printf("Test 2: Assignment works properly.\n"); } I assume that if the comma operator EVER produces an lvalue, it does so if and only if the right operand is an lvalue. Is this correct? (Oh, BTW, sorry I forgot to sign my previous post about the macros) Chris Volpe GE Corporate R&D volpecr@crd.ge.com