#include<iostream.h> typedef void (*fp)();
void menu1() { cout<<"Edit unit details\n\n"; } void menu2() { cout<<"Add student\n\n"; } void menu3() { cout<<"Display units\n\n"; }
void menu4() { cout<<"Display student\n\n"; }
void main() { int choose; fp fun[]={menu1,menu2,menu3,menu4}; do{ cout<<"\n Welcome to UnitData " <<"\n" <<"\t 1--Edit unit details\n\n" <<"\t 2--Add student\n\n" <<"\t 3--Display units\n\n" <<"\t 4--Display student\n\n" <<"\t 0--Exit\n" <<"\t Please choose an option:"; cin>>choose; switch(choose){ case 1:fun[0]();break; case 2:fun[1]();break; case 3:fun[2]();break; case 4:fun[3]();break; case 0:break; default:cout<<"You entered a wrong key.\n\n"; } }while(choose); } 帮忙看下有没错误啊