int dims = 0; int dim() { dims = dims + 1; return 10; } void foo() { int[10, dim()] arr; arr[1, 0] = 1; }