Would any one please explain this instruction for me:
for (;;)
I have encountered several kinds of these mark (like in ajax code of facebook and in concurrent stuff of Java).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An infinite loop.
Each of the three parts of a for loop (
for(x; y; z)) is optional.So you can do this:
and it’s perfectly valid, or
or
and they’re all valid.
You can also omit all three parts, with
for(;;). Then you have a loop that:so basically an endless loop. It just does what it says in the loop body, again and again