Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!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, 17 Dec 2012 19:53:26 -0600 Message-ID: <50CFCC9D.2D2A@mindspring.com> Date: Mon, 17 Dec 2012 20:53:33 -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: comma in a c statement, ie for(i=0,i2=0;i<10;i++,i2) References: <87hanlj6yl.fsf@bazspaz.fatphil.org> <874njkjskj.fsf@bazspaz.fatphil.org> <50CFB97C.3988@mindspring.com> <0.3d0bd95e6186d1006003.20121218013242GMT.87a9tcb0w5.fsf@bsb.me.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 40 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.156.228.63 X-Trace: sv3-AzDxF9BMoFJy34gSFptY/cFtCxQ+sM6eHk3QFgW/PHXa6jb+OktNrKyoEj3GSCXUwvJiIvTNC53de4f!1KDCox8X1XlwDySXneJO4MxNVj50nOU5BwUuCtyAbMCGxeo6ZOIWwuQ/+kB0hifk9lpY01oWQqzG!DM1cbFVnaA== 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: 2258 X-Received-Bytes: 2399 Xref: csiph.com comp.lang.c:29455 Ben Bacarisse wrote: > > pete writes: > > > Phil Carmody wrote: > >> Phil Carmody writes: > >> > This reinforces something that I've spotted historically > >> > - there seems to be some strange fetish > >> > for using the swiss-army for(;;) > >> > where while() is perfectly suitable. > >> > >> Perhaps I should have worded those as just > >> "for" and "while", I wasn't > >> trying to imply the "(;;)" part, just the iteration statements. > > > > for (;;) is special. > > > > while () , doesn't compile, > > even though K&R 3.5 says that they are equivalent. > > That's a very odd reading of the text! I've tried a few times and I > can't get that meaning from what's written in my K&R. The for statement for (expr1; expr2; expr3) statement is equivalent to expr1; while (expr2) { statement expr3; } except for the behavior of continue, which is described in 3.7. -- pete