Infinite loop application - for(;;)

后端 未结 5 757
一生所求
一生所求 2020-12-22 03:29

I am trying to understand the concept behind the for loop example

for (;;)
{
//write code
}

I understand what it does and how it\'s the sa

5条回答
  •  粉色の甜心
    2020-12-22 03:58

    This is just a matter of personal preference. For instance I much prefer this style:

     while (true) {
         // Do infinite task
     }
    

    It all comes down to readability, go with whatever is easy for you to read and understand months later.

提交回复
热议问题