Re: for loop (c-lang)



J French wrote:
The real thing is that 'C' has its own rules and being supremely
illegible the OP that managed to post in a totally inappropriate group
failed to see that the expression in Delphi evaluates to :

For N := 0 To 0 Do

And it is pretty obvious that it will do its thing once.

The expression in Delphi is equivalent to this:

while False do
Write('Why');

Your code is equivalent to this:

for (int N = 0; N <= 0; ++N)

The condition in the middle is evaluated *before* executing the body of the loop. Immediately before the loop terminates, the condition is also evaluated once more, but since it evaluates to False, the body is not executed afterward.

--
Rob
.