Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!itivax!umich!dip.eecs.umich.edu!smk From: smk@dip.eecs.umich.edu (Steve kelley) Newsgroups: comp.lang.c Subject: Re: comma operator Message-ID: <212@zip.eecs.umich.edu> Date: 4 Aug 89 14:50:43 GMT References: <10099@mpx2.mpx.com> <93@microsoft.UUCP> <10100@mpx2.mpx.com> <44c53d5b.f9df@gtephx.UUCP> <1351@cbnewsl.ATT.COM> <3287@ohstpy.mps.ohio-state.edu> Sender: news@zippy.eecs.umich.edu Reply-To: smk@dip.eecs.umich.edu.UUCP (Steve kelley) Organization: University of Michigan EECS Dept., Ann Arbor, MI Lines: 20 In article <3287@ohstpy.mps.ohio-state.edu> SMITHJ@ohstpy.mps.ohio-state.edu writes: >In article <1351@cbnewsl.ATT.COM>, mpl@cbnewsl.ATT.COM (michael.p.lindner) writes: >> Sigh. RTFM! The comma operator guarantees left to right evaluation, > >Maybe I'm mistaken, but I'm sure that all the documentation I've read warns >that the *comma* operator ----does not----- guarantee evaluation in any order. >Specifically, the Microsoft 5.0 manual mentions this. > >/* Jeffery G. Smith, BS-RHIT (AKA Doc. Insomnia, WMHD-FM) * I'm afraid you are mistaken. In particular, the Microsoft C Language Reference version 5.0 specifically mentions: "The sequential-evaluation operator evaluates its two operands sequentially from left to right. There is a sequence point after the first operand. The result of the operation has the same value and type as the right operand. Each operand can be of any type. ... The sequential-evaluation operator, also called the "comma operator," [sic] is typically used to evaluate two or more expressions in contexts where only one expression is allowed." Steve Kelley