Code:
#include <iostream>
#include <stdlib.h>
#include <windows.h>
char draw_menu(char title[50], char op1[50], char op2[50], char op3[50], char op4[50])
{
cout << "[" << title << "]\n\n";
cout << "1. " << op1 << endl;
cout << "2. " << op2 << endl;
cout << "3. " << op3 << endl;
cout << "4. " << op4 << endl;
}
int main()
{
draw_menu("Main Menu", "Start game", "High Scores", "Help/About", "Exit");
Sleep(10000);
}
I want to be able to add more than 4 options to draw_menu,
but I don't want to make it look like this
Code:
char draw_menu(char title[50], char op1[50], char op2[50], char op3[50], char op4[50], char op5[50], char op6[50], char op7[50], char op8[50])
What can I do?
ANOTHER QUESTION! Is it ok to do this
Code:
game()
{
....
menu(); //getting back to menu so it won't exit right away
}
menu()
{
...
game();
}
int main()
{
menu();
}
Can I just call menu() to get back to it or should I do a while() and return a value?