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

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

    This is very common on embedded systems without an operating system. If your program terminates, there is no underlying system to handel that. So mostly there's one huge infinite loop in which most of the operations are handled.

提交回复
热议问题