Code:
#include <stdio.h>
const char ONE[9][6] = {
{'_','_','_','8','_','_'},
{'_','_','8','8','_','_'},
{'_','8','_','8','_','_'},
{'_','_','_','8','_','_'},
{'_','_','_','8','_','_'},
{'_','_','_','8','_','_'},
{'_','_','_','8','_','_'},
{'_','_','_','_','_','_'},
{'_','_','_','_','_','_'}
};
const char TWO[9][6] = {
{'2','2','_','8','_','_'},
{'2','_','8','8','_','_'},
{'_','8','_','8','_','_'},
{'_','_','_','8','_','_'},
{'_','_','_','8','_','_'},
{'_','_','_','8','_','_'},
{'_','_','_','8','_','_'},
{'_','_','_','_','_','_'},
{'_','_','_','_','_','_'}
};
typedef const char (*foo)[9][6];
// foo is a type, which is a pointer to array[9][6] of const char
void func ( foo arr ) {
int r, c;
for ( r = 0 ; r < 9 ; r++ ) {
for ( c = 0 ; c < 6 ; c++ ) {
printf("%c", (*arr)[r][c]);
}
printf("\n");
}
}
int main()
{
foo all[] = {
&ONE,
&TWO
};
func(all[1]);
return 0;
}
The sanity way out is to create a typedef which is the pointer to your arrays.