Re: A89: Clearing a string


[Prev][Next][Index][Thread]

Re: A89: Clearing a string




On Tue, 4 Jul 2000, Olle Hedman wrote:

> I suddenly started to doubt myself. (after all it is 7am an I haven't
> slept this night) Don't be suprised if I'm totally wrong :) I will
> check it up after I have slept if noone has before.

The condition of the for loop is actually tested at the beginning of each
loop, not the end, the result being that the statements in the loop won't
even be executed once if the second expression is initially false;

>From "The C Programming Language" by Kernighan and Ritchie:

The for statement

   for (expr1; expr2; expr3)
        statement

is equivalent to

   expr1;
   while (expr2) {
        statement
        expr3;
   }





References: