break; question!
May 12, 2013 at 3:08am
If i have a loop like this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
while(counter!=0){
if(x==0)
cout<<"hi"<<endl;
while(y!=0){
if(y==letter){
condition=true;
}
else{
condition=false;
break;}
}
}
|
would the break; break out of both loops? or just the loop it is in?
Thank you for your time.
May 12, 2013 at 3:11am
It only breaks out of the inner-most loop.
May 12, 2013 at 3:12am
great, thank you for the quick response!
Topic archived. No new replies allowed.