i have often seen statements written like this :
while(1){} for example...
if the sentinel in the while statement is not a va riable, how is the loop going to end? how are we gonna end the loop?
i have often seen statements written like this :
while(1){} for example...
if the sentinel in the while statement is not a va riable, how is the loop going to end? how are we gonna end the loop?
Only by the cross are you saved...
while(1) will keep on going forever just like
for( ; ; )
you can break; out of the loop
It doesn't. What you have is a infinite loop.Originally posted by fkheng
i have often seen statements written like this :
while(1){} for example...
if the sentinel in the while statement is not a va riable, how is the loop going to end? how are we gonna end the loop?
Inside the block a break; is executed to break out of the loop.
This type of while can be used when there is no clear sentinel to exit the loop.
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers