Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site eagle.UUCP Path: utzoo!watmath!clyde!burl!ulysses!eagle!mjs From: mjs@eagle.UUCP (M.J.Shannon) Newsgroups: net.lang.c Subject: Re: for <==> while (an exception) Message-ID: <1280@eagle.UUCP> Date: Fri, 12-Jul-85 14:24:50 EDT Article-I.D.: eagle.1280 Posted: Fri Jul 12 14:24:50 1985 Date-Received: Sat, 13-Jul-85 12:45:43 EDT References: <200@ur-cvsvax.UUCP> Distribution: net Organization: AT&T Bell Laboratories, Summit, NJ Lines: 16 > Section 3.5 of K&R (p. 56) states that the 'for' loop and 'while' loop > can be made equivalent.... > > Well ... almost. > If 'statement' contains a 'continue' statement, things may go awry. If you look in the reference manual which is contained in K&R, you will see that the semantics of the continue statement are fully described in terms of equivalences among while, do-while, and for loops. Section 9.9 (p. 203) clears up the `exception' you perceive. Please bear in mind that the section that you quoted is part of a tutorial, and so all the gory details aren't presented at once or in the same place. -- Marty Shannon UUCP: ihnp4!eagle!mjs Phone: +1 201 522 6063