[Info-vax] decrementing & for loops in C

Bob Eager rde42 at spamcop.net
Thu Jan 8 10:45:03 EST 2009


On Thu, 8 Jan 2009 15:42:01 UTC, billg999 at cs.uofs.edu (Bill Gunshannon) 
wrote:

> But in any case, use of the assignment operator is always going to
> cause the loop to end

Only if zero is being assigned....the 'value' of an assignment is the 
eventual value of the LHS.

 i = 0               would cause the loop to terminate
 i = 1               would cause it to run forever...!

Luckily most compilers, as you say, will warn about this. I'm sure we've
all done it!
-- 
Bob Eager




More information about the Info-vax mailing list