Hi, all~
we know arrays could be passed as arguments but tridimentional arrays looks a bit different from simply arrays. That is, we could implement our function like this:
why the first [] could be blank ?Code:int myFunction (int arr[][4][5]);
Hi, all~
we know arrays could be passed as arguments but tridimentional arrays looks a bit different from simply arrays. That is, we could implement our function like this:
why the first [] could be blank ?Code:int myFunction (int arr[][4][5]);
Never end on learning~
>why the first [] could be blank ?
The function doesn't need the first dimension to determine the size of the array. Simplified, this:
void func ( int array[10] );
is equivalent to
void func ( int *array );
Notice that the one dimensional array is converted to a simple pointer, so no size information is needed. A multidimensional array however, needs size information for the latter dimensions:
void func ( int array[10][10] );
is equivalent to
void func ( int (*array)[10] );
The first dimension is still a pointer, but the second is an array reference, it needs a size.
-Prelude
My best code is written with the delete key.