c - 3d array as function argument -
i have function takes 2d-array argument. have 3d-array e.g. temp[5][100][100]
. want pass 2d portion of array function. how can this?
int inteference_sets(int array[][],int array_size,int max_channel){ //function codes } int main(){ int k; int temp[5][100][100]; for(k=1;k<=4;k++){ interference_sets(temp[k], , ) //this how program intends work } }
is possible? if yes, how?
#define dim1 100 #define dim2 100 int inteference_sets(int (*array)[dim2], int array_size, int max_channel) { int row, col; for( row = 0; row < array_size; row++ ) { for( col = 0; col < dim2; col++ ) { int value = array[row][col]; //function codes } } } int main() { int k; int temp[5][dim1][dim2]; for(k=1;k<=4;k++) { interference_sets(temp[k], dim1, ) //this how program intends work } }