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

后端 未结 10 1085
迷失自我
迷失自我 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:41

    It's the same as while (true) { /**/ } ... infinite loop until break or return or similar occurs.

    All it really "does" is look ugly IMO ;)

提交回复
热议问题