Incomplete array declarations can be "incomplete" only in the "first" dimension. The reason is this: Suppose you have an array like yours:
To access the element arr[i][j] the compiler uses the base pointer (arr) and the offset 69*i+j to find the correct element.. So, all the elements, except the "first" must be known by the compiler. This way, you can pass an incomplete array as argment this way:
Code:
int f( int arr[][69] ) { return arr[3][6]; }
Here, the offset will be 69*3+6 (213).
Another way to do it is to work with pointers, but your code must know the dimensions, the same code as above, but using a single pointer (as a base for the array, could be:
Code:
int f( int *arr ) { return a[69*3+6]; }
You only have to be cautions to pass this pointer correctly:
Code:
int arr[421][69];
...
y = f( (int *)arr );
Of course, you can pass the dimensions of your array (not the first one) to the function:
Code:
int f( int *arr, unsigned int columns,
unsigned int i, unsigned int j )
{ return arr[columns * i + j]; }
Now, let's consider a three dimmentional array:
The principle is the same... find an element (i,j,k) from a array with dimmentions (x,y,z) the offset is calculated as: (y*z*i + z*j + k). So the incomplete array, again, has the "first" element empty because it isn't needed to calculate the offset (which will be added to the base pointer 'arr'):
Code:
int f( int arr[][4][5] ) { return arr[3][3][3]; }
Or:
Code:
int f( int *arr, unsigned int y, unsigned int z,
unsigned int i, unsigned int j, unsigned k )
{
return arr[y*z*i + z*j + k];
}