Menu doesn't run
I'm trying to put a menu into my program and it just doesn't the int menu() function. Just goes straight past it
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
void tempAvg(weather[], int);
void getData(weather[]);
void maxMinTemp(weather[], double&, double&);
void finalStats(weather[]);
double arrayAvg(weather[], char[]);
int menu(int menu);
void showMenu(int showMenu);
int menu()
{
int choice;
do
{
showMenu();
cin >> choice;
if (choice > 2 || choice < 1)
cout << "Error! Please enter a value between 1 and 2." << endl;
else if (choice == 1)
weather array[months];
else if (choice == 2)
return 0;
} while (choice != 1);
}
int main()
{
int menu(int);
weather array[months];
getData(array);
finalStats(array);
return 0;
}
//Menu
void showMenu()
{
cout << "Please follow the instructions." << endl;
cout << "Please press 1 to start the program." << endl;
cout << "Please press 2 to exit the program." << endl;
}
|
Last edited on
Topic archived. No new replies allowed.