P
pete
Keith said:Or:
while (1) { ... }
(Let's not have a lengthy debate about which one is clearer, better,
and/or more idiomatic, ok?)
You've got to be kidding!!!
First of all:
for (; { ... } gives No warning on MY compiler.
(for one specific value of "me").
while(1) gives me a warning about a conditional test expression
being constant.
Second of all:
for (; { ... } is the K&R example for an endless loop.
Third of all:
It's a special rule in the language for endless loops.
for (;1; /* compiles */
for (; ; /* compiles */
while(1); /* compiles */
while( ); /* doesn't compile */