Be careful when moving lines of code

22. December 2010 One-Time 0

Going from

do {
}while (x == true);

to

while(x == true) { }

Should simply change it from always executing the first time, to only when the condition is true. However, going to

while(x == true); { }

will create an endless loop (notice the semicolon)


Leave a Reply

Your email address will not be published. Required fields are marked *