That is NOT a good practice to use. We won't start the discussion here, but just don't use goto.
I'm not sure if I can explain it any better but using the class design I showed you is much more versatile and will work for every menu in your game.
Stay away from goto's.
Change your approach to an object oriented design and you will have much more success. So what do you do when you have an in-game menu, re-write all that code again? Doesn't that seem kind of redundant?
Wouldn't it be easier to do something like this:
Code:
CMenu *pMainMenu=new CMenu();
pMainMenu->SetTitle("Please choose an option",2,ALIGN_HORIZ);
pMainMenu->AddItem("Start game",ALIGN_HORIZ);
pMainMenu->AddItem("Load game",ALIGN_HORIZ)
pMainMenu->AddItem("Options",ALIGN_HORIZ);
pMainMenu->AddItem("Exit",ALIGN_HORIZ | MENU_EXIT);
CMenu *pMenu=new CMenu();
pMenu->SetTitle("Select a difficulty",5,ALIGN_HORIZ);
pMenu->AddItem("Easy",ALIGN_HORIZ);
pMenu->AddItem("Normal",ALIGN_HORIZ);
pMenu->AddItem("Hard",ALIGN_HORIZ);
pMenu->AddItem("Back",ALIGN_HORIZ);
pMenu->SetPrev("Back",pMainMenu);
pMainMenu->SetNext("Options",pMenu);
int result=pMainMenu->RunMenu();
This would set the difficulty menu as a sub menu of main menu item 3 or Options. If you select back in Options, it has it's previous menu set as pMainMenu and it would return to that menu.
Each menu item then can have a CMenu object next and prev associated with it. This is very similar to a Windows menu bar that has submenu's, sub-popups with sub-menus, etc.
You could use function pointers but with classes you will run into some issues, but it's not impossible. Or you could just respond by returning an integer from RunMenu() which indicates the user's reponse. The SetPrev and SetNext functions would assign prev and next menu's to an item. RunMenu() would understand this and would auto-switch the menu's if the user selected the item specified in these calls.
Using this you could setup menu's from templates on disk and then run them at any point in your game.
A couple of objects to handle everything. No re-typing lines and lines of code for every menu you need and everything is encapsulated. Just what you want.
Based on those functions you should be able to design a CMenu class and a CMenuItem class. CMenu should have:
Public functions
void SetTitle(LPCSTR strTitle,int Row,int iAlignMode)
int AddItem(LPCSTR strName,int iAlignMode);
void DeleteItem(int index);
void DeleteItem(CMenuItem *pItem);
bool InsertItem(LPCSTR strName,int iInsertAfter,int iAlignMode);
int RunMenu(void);
bool SetNext(LPCSTR strName,CMenu *pMenu);
bool SetNext(int iIndex,CMenu *pMenu);
bool SetNext(CMenuItem *pItem,CMenu *pMenu);
bool SetPrev(LPCSTR strName,CMenu *pMenu);
bool SetPrev(int iIndex,CMenu *pMenu);
bool SetPrev(CMenuItem *pItem,CMenu *pMenu);
CMenuItem *GetMenuItem(int index);
Private functions
void UpdateMenu(void);
void DisplayMenu(void);
void GetInput(void);
I leave the rest to you. But it's a good start I think.