Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: comma operator Message-ID: <5418@ficc.uu.net> Date: 1 Aug 89 18:46:32 GMT References: <10099@mpx2.mpx.com> <93@microsoft.UUCP> <10100@mpx2.mpx.com> <13184@bloom-beacon.MIT.EDU> Organization: Xenix Support, FICC Lines: 28 Herewith the only use for the comma operator outside a macro that I can think of: for(init1, init2; test; incr1, incr2)... For example: for(i = 0, c = first(); i < MAX && c != TERM; i++, c = next()) whatever...; This can be written, at the cost of some logical relatedness: i = 0; c = first(); while(i < MAX && c != TERM) { whatever...; i++; c = next(); } Which is IMHO less readable. In addition, if !whatever...;! contains any !continue! statements, they would have to be implemented as gotos or the !i++; c = next();! would have to be duplicated. -- Peter da Silva, Xenix Support, Ferranti International Controls Corporation. Business: peter@ficc.uu.net, +1 713 274 5180. | "The sentence I am now Personal: peter@sugar.hackercorp.com. `-_-' | writing is the sentence Quote: Have you hugged your wolf today? 'U` | you are now reading"