In the following code, does the break statement break out of the if statement only or out of the for loop too?
break
if
for
I need it to b
It also goes out of the loop.
You can also use labeled breaks that can break out of outer loops (and arbitrary code blocks).
looplbl: for(int i=;i<;i++){ if (i == temp) // do something else { temp = i; break looplbl; } }