Is “while (true)” usually used for a permanent thread?

后端 未结 6 1160
温柔的废话
温柔的废话 2021-02-04 07:18

I\'m relatively new to coding; most of my \"work\" has been just simple GUI apps that only function for one thing, so I haven\'t had to thread much.

Anyway, one thing I\

6条回答
  •  盖世英雄少女心
    2021-02-04 08:13

    Just as some additional info, typical none ending loops use

    for(;;)
    {
     ...
    } 
    

    as there is no compare done in the loop. When doing threads it is best to check a flag if the loop to end or not though.

提交回复
热议问题