In C# is a for(;;) safe and what does it really do?

后端 未结 10 1157
迷失自我
迷失自我 2021-01-17 12:59

I found an empty for statement in an existing bit of code and I\'m wondering what it does and is it \"safe\". It just feels wrong.

for(;;)
{
   //some if sta         


        
10条回答
  •  耶瑟儿~
    2021-01-17 13:28

    This has been asked multiple times on SO. The best discussion on the topic is at the following link:

    Is "for(;;)" faster than "while (TRUE)"? If not, why do people use it?

提交回复
热议问题