There is no excuse for a goto statement. Goto statements are the way you program if you do ASM, or some crummy thing like PBasic (which I had to learn as it would allow programming of one type of microcontroller). Goto statements are what you use when there IS nothing better.
It is actually much HARDER to program with gotos that without. No good program will ever use them. It is never the best way, and never the most intuitive way.
A menu works MUCH better like this:
Code:
char choice;
bool inMenu = true;
while(inMenu){
PresentPrompt();
cin >> choice;
switch(choice){
case 'a':
case 'A':
KeyA();
break;
// Other cases as needed
case 'q':
case 'Q':
DoCleanup();
inMenu = false;
break;
}
}
Using this, you can see at a glance how flow happens. With gotos, your code becomes much more convuluted, your flow becomes tricky to decipher, and there are many kinds of errors you can accidently cause.