- 1
is we can write for(; ;); for any exceptional case?
2 Answers
+ 3
What do you mean?
for(; ;) is the same as while(true)
it gives you an infinite loop.
You can escape it by putting a break condition inside, like e.g.
int i = 4;
for(;;){
i++;
if(i==10){
break;
}
}
+ 1
thats what i want to know thanku very much...