[Info-vax] decrementing & for loops in C

Bob Eager rde42 at spamcop.net
Thu Jan 8 08:17:47 EST 2009


On Thu, 8 Jan 2009 13:07:17 UTC, FrankS <sapienza at noesys.com> wrote:

> The conditional equivalance operator in C is == not =.
> 
> Your syntax error occurs in the FOR statement.  You have:
> 
>    for (i = n; i = 0; i--)

No, it's syntactically correct. Not what is wanted, perhaps, but 
syntactically correct.
There is a semantic error if a countdown loop is wanted.

> but it should be:
> 
>    for (i = n; i == 0; i--)

No....it should be:

    for (i = n; i != 0; i--)

(see my other post)
-- 
Bob Eager




More information about the Info-vax mailing list