我一直在查看我使用的应用程序的一些示例源代码,我遇到了这一行:
for (;;)
{
// The rest of the application's code
}
Run Code Online (Sandbox Code Playgroud)
看起来这是创建一个无限循环,但我不熟悉";;" 不幸的是谷歌很难.
Mar*_*ers 16
是的,这是一个无限循环.它是一个普通的for循环,没有条件表达式.
从以下文档for:
for语句的所有表达式都是可选的; 例如,以下语句用于编写无限循环:
Run Code Online (Sandbox Code Playgroud)for (; ; ) { // ... }
| 归档时间: |
|
| 查看次数: |
45926 次 |
| 最近记录: |