>>614
mallocはそのためにある。
int *array = malloc(sizeof(int)*a);

でもgccだと拡張機能(array of variable length)で
 int a=3;
 int array[a];
が通ってしまうのはヒミツだ。