2 * $Id: badidx.c,v 1.1 2002/08/22 03:04:14 vadve Exp $
3 * http://www.bagley.org/~doug/shootout/
5 * this program is modified from:
6 * http://cm.bell-labs.com/cm/cs/who/bwk/interps/pap.html
7 * Timing Trials, or, the Trials of Timing: Experiments with Scripting
8 * and User-Interface Languages</a> by Brian W. Kernighan and
9 * Christopher J. Van Wyk.
11 * I added free() to deallocate memory.
18 main(int argc, char *argv[]) {
19 int i, n = ((argc == 2) ? atoi(argv[1]) : 1);
20 int *y = (int *) calloc(n, sizeof(int));
23 printf("%d\n", y[n-1]);