In the following code, does the break
statement break out of the if
statement only or out of the for
loop too?
I need it to break out of the loop too.
for (int i = 0; i < 5; i++) {
if (i == temp)
// do something
else {
temp = i;
break;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…