void open (void);
void insert (void);
void search (void);
void update (void);
voiddelete (void);
void display (void);
void save (void);
struct comp
{
int code;
char name [27];
des char [52];
int avail;
struct comp * n;
};
struct comp * comps = 0;
void (* cmd []) (void) = {open, insert, search, update, delete, display, save};
int main ()
{
int c;
for (;;)
{
scanf ("%i", &c);
(*cmd[c ])();
}
}
How do I edit prototype and declarations of functions and the vector of function pointers to declare comps in the main function and pass it as a parameter to all the other functions?