"for" loops (was Re: C++ vs. Modula2)
T. William Wells
bill at twwells.uucp
Mon Jan 30 08:57:13 AEST 1989
In article <1626 at csuna.UUCP> abcscagz at csuna.csun.edu (Jeff Boeing) writes:
: Hoo boy, did I ever mess up in my last posting.
: I forgot that a C "for" loop may be executed zero times.
: So, let me rephrase my conviction that a C "for" loop is superfluous
: because it can be replaced by an equivalent "while" loop, NOT an
: equivalent "do ... while" loop:
C is superfluous because it can be replaced by an equivalent assembly
program.
---
The C for loop exists because it encapsulates the common initialize,
test, and update control structure; it does not exist because such
encapsulation can't be written any other way, or to save keystrokes,
or any other such irrelevant reason.
---
Bill
{ uunet!proxftl | novavax } !twwells!bill
More information about the Comp.lang.c
mailing list