#include <stdio.h>

int f1 (int i) { return 17; }
int f2 (int i) { return i; }
int f3 (int i) { return i+17; }

int main (int argc, char (*argv)[]) {
  /* array of pointers to functions of the form "int f(int)" */
  int(*fs[17])(int);
  /* pointer to array of pointers to functions of the form "int f(int)" */
  int(*(*pfs)[])(int);
  pfs = &fs;
  /* assign function pointers (using pfs) */
  (*pfs)[0] = &f3;
  (*pfs)[1] = &f1;
  (*pfs)[2] = &f2;
  int index;
  /* execute functions by use of array */
  for (index = 0; index < 3; ++index) {
    printf("function %d, param==39, returns %d\n",
           index, (*(*pfs)[index])(39));
  }
}

