/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>
#include <stdlib.h>

typedef void (*fptr)();

void f1()
{
   printf("f1\n");
}

void f2()
{
   printf("f2\n");
}

void f3()
{
   printf("f3\n");
}

void f4()
{
   printf("f4\n");
}

int main()
{
    fptr f[] = { f1, f2, f3, f4 };
    int i;
    srand(12345);
    for(i=0;i<10;i++)
    {
        f[rand() % 4]();
    }
    return 0;
}
