I have another problem,and that is after let's say you have three options,and you choose one in which there's a dead end,how do you make it return to the menu,so you can try again,instead of letting the program exit?
I have another problem,and that is after let's say you have three options,and you choose one in which there's a dead end,how do you make it return to the menu,so you can try again,instead of letting the program exit?
what works best is something like:Code:while (1) { // All your other stuff. }
Wrap your whole program in a loop that only exits when you explicitly set some 'exit variable' to a certain value. At the beginning of the loop have your main menu, so that any execution path that would result in accidentally ending the program just returns you there. Problems like this could be a sign that you'd benefit from restructuring / refactoring your code into pieces that make sense. That's hard to do without really understanding all your code though - so it's just a suggestion.