- 1

is we can write for(; ;); for any exceptional case?

31st Jul 2018, 2:12 PM
shrish suryvanshi
shrish suryvanshi - avatar
2 Antworten
+ 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; } }
31st Jul 2018, 2:27 PM
Matthias
Matthias - avatar
+ 1
thats what i want to know thanku very much...
31st Jul 2018, 5:08 PM
shrish suryvanshi
shrish suryvanshi - avatar