Infinite loops
Chris Torek
chris at umcp-cs.UUCP
Thu Apr 17 08:41:58 AEST 1986
In article <577 at ur-helheim.UUCP> badri at ur-helheim.UUCP
(Badri Lokanathan) writes:
>There are several ways of creating infinite loops:
Namely, `while (1)' and `for (;;)'. (There are others, but these
seem to be the nominal standard.)
>... is there any reason (other than personal preferance) why one
>would prefer to use any particular form?
Some compilers generate a `test the constant 1' for the former
sequence, and no test for the latter; but I imagine that by now
this is rather rare.
>I personally prefer the while(1) form since it seems to make better reading.
Oddly enough, I prefer the other form, but for the same reason.
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415)
UUCP: seismo!umcp-cs!chris
CSNet: chris at umcp-cs ARPA: chris at mimsy.umd.edu
More information about the Comp.lang.c
mailing list