I'm still a newbie in programming, but I'm trying to make a program that's slightly larger and consists in way more functions than usual. And I want to make a repeatable 'Main menu' (which from you can access the rest of program's functions), but when I'm trying to call out the function again, nothing's happening. It looks like this:
void mainMenu()
{
//clear console screen
//menu of the program
//i.e "Press 1 to choose something
//console screen is cleared again, then new options appear
//"Press E to go back to main menu"
unsigned char v;
v = getch();
if (v == 'E')
mainMenu();
}
What am I doing wrong? Shouldn't the mainMenu() be called out again, clear screen etc? I guess I could just return something from function which would cause the program to call mainMenu() again (and change mainMenu() to int for example), but there must be some workaround, which I'm missing.