#include <iostream>
#include <windows.h>
using namespace std;
void about(){
cout<<"Expence-List 14/10/2008:"<<endl
<<"Brought to you by www.******.com"<<endl
<<"Programmed by **********."<<endl;
Sleep(4000);
system("cls");
}
int MenuOne(){
int MenuSelection=0;
cout<<"What would you like to do?"<<endl
<<"--------------------------------"<<endl
<<"1. Create a new expence list."<<endl
<<"2. Edit a previous expence list."<<endl
<<"3. View a saved expence list."<<endl
<<"4. Settings"<<endl
<<"5. About."<<endl
<<"6. Close Program"<<endl
<<"--------------------------------"<<endl
<<endl;
cin>>MenuSelection;
system("cls");
return MenuSelection;
}
int MenuProcessing(int MenuSize,int MenuSelection){
int b=1;
if(MenuSelection>MenuSize){
cerr<<"You've entered an invalid option!"<<endl
<<"Try again!."<<endl;
Sleep(2000);
system("cls");
return 0;
}
while(MenuSize>b){
if(MenuSelection=b){
}
}
b++;
}
int main(){
start:
int MenuSelection=0,EventStatis;
about();
MenuSelection=MenuOne();
EventStatis=MenuProcessing(6,MenuSelection);
if(EventStatis=0){
goto start;
}
return 0;
}
so thats my code right.
where it says the function menuprocessing. I need a menuprocessing thingo cause i using lots and lots of menus.
so what i want is for where the
while(MenuSize>b){
if(MenuSelection=b){
}
}
is i want it to send it to the approbate selected menu thing.
so something like a function array....
void MenuOne[1](){
}
so when
MenuMelection=b
it would go to the
MenuOne[b]();
sucks that function arrays don't exist.
how would i go about doing something like that?