/* 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>
#include <malloc.h>

void f(int n)
{
    int i,*a;
    a = (int *)alloca(n*sizeof(int));
    for(i = 0; i < n; i++)
    {
        a[i] = i;
    }
    for(i = 0; i < n; i++)
    {
        printf("%d\n", a[i]);
    }
}

int main()
{
    f(1);
    f(2);
    f(3);
    f(4);
    return 0;
}
