Liste des Groupes | Revenir à cl c |
On Sun, 02 Jun 2024 13:24:23 +0000, Kenny McCormack wrote:
>In article <v3gou9$36n61$3@dont-email.me>,>
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>On Fri, 31 May 2024 17:55:13 -0500, Lynn McGuire wrote:
>while (1)>
Why not
>
while (true)
>
or even
>
for (;;)
>
?
I've always considered
for (;;)
preferable over
while (1)
as the for (;;) expression does not require the compiler to expand
and evaluate a condition expression.
>
For the for (;;), the compiler sees the token stream <LPAREN>
<SEMICOLON> <SEMICOLON> <RPAREN>, and emits a closed loop, but
with while (1), the compiler sees <LPAREN> <CONSTANT> <RPAREN>,
and has to evaluate (either at compile time or at execution
time) the value of the <CONSTANT> to determine whether or or
not to emit the closed loop logic.
Les messages affichés proviennent d'usenet.