//includes
int main() {
int a, b, c;
cin>>a;
cin>>b;
cin>>c;
if(a == 0) goto one;
else goto two;
one:if(b == 0) goto nine;
else goto ten;
two:if(c == 0) goto six;
else goto seven;
nine:if(a > 0) goto two;
//etc etc
}
) and it does basically make the code harder to follow etc.
{
{
{
{
cout << stuff 0;
break;
cout << stuff 1;
}
cout << stuff 2;
}
cout << stuff 3;
}
cout << stuff 4;
}
while(1)
{
for(int i=0;i<100;i++)
{
if(i==66)
{
break;
}
if(i==72)
{
cout<<"i is now 72 o__O";
}
}
//ends up here all the time so the 2nd if statement is never triggered i think
}
#include <iostream>
using namespace std;
int main()
{
{
{
{
cout << "stuff 0";
break;
cout << "stuff 1";
}
cout << "stuff 2";
}
cout << "stuff 3";
}
cout << "stuff 4";
cin.get();
return 0;
}
9 C:\Dev-Cpp\test break.cpp break statement not within loop or switch

{
{
{
DoSomething();
}
DoSomethingElse();
}
}
DoSomething(); DoSomethingElse();