/* menu.c: *
* Illustrates arrays of functions */
#include <stdio.h>
/* You must provide definitions *
* for these */
extern void retrieve(void);
extern void insert(void);
extern void update(void);
extern int show_menu(void);
main()
{
int choice;
void (*farray[])(void) =
{retrieve,insert,update};
for (;;)
{
choice = show_menu();
if (choice >= 1 && choice <= 3)
/* Process request */
farray[choice-1]();
else if (choice == 4)
break;
}
return 0;
}
/* End of File */