/* 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)
            farray[choice-1]();     /* Process request */
        else if (choice == 4)
            break;
    }
    return 0;
}
