Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!rutgers!dptg!ulysses!andante!alice!debra From: debra@alice.UUCP (Paul De Bra) Newsgroups: comp.lang.c Subject: Re: comma operator Message-ID: <9736@alice.UUCP> Date: 4 Aug 89 13:25:07 GMT References: <10099@mpx2.mpx.com> <93@microsoft.UUCP> <10100@mpx2.mpx.com> <918@helios.toronto.edu> <13074@megaron.arizona.edu> Reply-To: debra@alice.UUCP () Organization: AT&T, Bell Labs Lines: 36 In article <13074@megaron.arizona.edu> robert@arizona.edu (Robert J. Drabek) writes: }... }I agree with you. The one place, though, where it is used is in "for" }loops: for (i = 0, j = 9; ...; i++, j--) } }I have seen the following "attempt" at using a comma operator in a function }call: } } func(expr1, expr2) } }The writer thought he was using the comma operator since the function }had been defined as having a single argument. He did get > } func((expr1, expr2)) } }to work. I don't know if all compilers would get this, though. The following is also a problem: if i have something like if (e) return; and want to get some debug output, i would try if (e) printf("Hi\n"),return; but this gives syntax error. (at least in the compilers i've tried) Note that if (e) printf("Hi\n"),exit(); compiles fine. It's just that "return" is treated differently. Paul -- ------------------------------------------------------ |debra@research.att.com | uunet!research!debra | ------------------------------------------------------