Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 31 Oct 2011 18:01:09 -0500 Message-ID: <4EAF28B8.7E25@mindspring.com> Date: Mon, 31 Oct 2011 18:01:12 -0500 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: the loop control References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 31 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.156.231.252 X-Trace: sv3-wi4TCch0l8uLrMsjr/v5tOCIjZnffT08lAKNYBY+KRo4sHI37uUgAmZvZxo3Jp4WEAs/+NlPlig6Xjy!XgOPNPJpy3ye3+sENsTHbu9khy5qMo3TlkJ/W08XSuh9X3JQMsztcNTxpMO8oBnj6MqhZAtr5NWz!OTVaTF+KbrE= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1573 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:12416 Joe keane wrote: > Anyway readability is key; to me code like > > ct = len; > fop = fob; > while (--ct >= 0) > { > ...(fop) > fop++; > } > > is so idiomatic that it's easiest. More idiomatic is: while (ct-- != 0) { ; } It's a natural for counting down through an array. unsigned array[10]; unsigned ct = sizeof array / sizeof *array; while (ct-- != 0) { array[ct] = ct; } -- pete