void foo(int X, int Y) { double a[X][Y]; .. }
In fact, this is one reason I switched away from C++, because arrays are so bad in C++.