Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!umich!sharkey!rjf001!amara!mcdaniel From: mcdaniel@adi.com (Tim McDaniel) Newsgroups: comp.lang.c Subject: Re: Comparing strings... Message-ID: Date: 17 Oct 90 15:04:07 GMT References: <2205.271700c2@cc.nu.oz.au> <1990Oct13.190106.15615@ux1.cso.uiuc.edu> <10678.271ade27@amherst.bitnet> <1990Oct17.030157.460@ux1.cso.uiuc.edu> Sender: news@adi.COM Organization: Applied Dynamics International, Inc.; Ann Arbor, Michigan, USA Lines: 37 In-reply-to: gordon@osiris.cso.uiuc.edu's message of 17 Oct 90 03:01:57 GMT gordon@osiris.cso.uiuc.edu (John Gordon) writes: > Also, one other thing: for() and while() loops are essentially > identical. "Essentially identical" is not identical to "identical". As Dad says, "'Close' only counts in horseshoes and hand grenades". > The following loops are exactly the same: Unless "continue" is used: in a "while" loop, control passes immediately to the conditional expression, but in a "for" loop, the third control expression is done before it goes to the conditional expression. So for (i = 0; i < 100; i++) { continue; } is identical to i = 0; while (i < 100) { goto uniqueLabel; uniqueLabel: i++; } To the best of my knowledge, they are otherwise identical. -- Tim McDaniel Applied Dynamics Int'l.; Ann Arbor, Michigan, USA Work phone: +1 313 973 1300 Home phone: +1 313 677 4386 Internet: mcdaniel@adi.com UUCP: {uunet,sharkey}!amara!mcdaniel