[英]What does the following for loop syntax mean in C?
I came across this syntax, not sure what it means. 我碰到过这种语法,不确定是什么意思。
for( ; ; )
{
//do stuff like read from a handle etc.
}
I am still on my learning curve in C so vote down if you want if it's a lame question. 我仍然在C语言中处于学习曲线上,因此如果这是一个me脚的问题,请拒绝。
It's an infinite loop. 这是一个无限循环。 Same as
while(1)
与
while(1)
相同
Really the only important thing to look at is that for loops look like for (initialize vars; continue condition; counters)
. 真正要看的唯一重要的事情是for循环看起来像
for (initialize vars; continue condition; counters)
。 Since there's no continue condition it just keeps going (unless there's a break or return statement in there somewhere). 由于没有继续条件,因此它将继续进行下去(除非那里某处有break或return语句)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.