haha i love it... lets get everyone in here for a Free for all...
Printable View
haha i love it... lets get everyone in here for a Free for all...
I think he's asking if code such as this is bad.
Code:void game_menu()
{
int choice = get_input();
switch(choice) {
case PLAY_GAME:
play_game();
break;
// more choices
}
void play_game()
{
while(!quit_game) {
// game stuft
// if pressed m goto game menu
game_menu();
}
}
IMO it all depends on the situation. generally speaking its not good and is not required but if there is a case where you have to do it just take neccessary precautions for smooth running after the break.
i dont think there would be any problem [i'm not sure] by using exit.Quote:
Originally posted by m00se123 i don't know if i mentioned that my prog does end, it just doesn't ever make to the end. i used the exit function to get out, and before i call that i call my own function to clean everything up. It is not like i just have an infinite loop.
Yeah, im in for one, but maybe in the GD board ;)Quote:
Originally posted by Liam Battle
haha i love it... lets get everyone in here for a Free for all...