My question is simple,thus I will not go in deep
can we use for()
loop without condition like this
for(;;space+=1)
{
printf(" ");
break;
}
My question is simple,thus I will not go in deep
can we use for()
loop without condition like this
for(;;space+=1)
{
printf(" ");
break;
}
Of course you can. An empty condition is taken to evaluate to 1
.
for (;;){/*ToDo - your code here*/}
is idiomatic C.
Yes it is perfectly correct to do so.
But since you have provided a break immediately after printf, it will only execute once. I'm not sure whether this is what you wanted. But if so, then this works fine.