Or you could 'flatten' the array. Here's something I wrote ages ago. It works for a 2D array, but you could arrange it for a 3D array too.
Code:
#include<stdio.h>
void print ( int *pnum, int x, int y )
{
for ( int j=0; j<y; j++, printf("\n") )
{
for ( int i=0; i<x; i++ )
{
printf( "%d ", *pnum++ );
}
}
}
int main( void )
{
int test22[2][2] = {{9, 8}, {7, 6}};
int test23[2][3] = {{9, 8, 7}, {6, 5, 4}};
int test33[3][3] = {{9, 8, 7}, {6, 5, 4}, {3, 2, 1}};
int test24[2][4] = {{9, 8, 7, 6}, {5, 4, 3, 2}};
printf( "Printing 2x2 matrix\n" );
print( &test22[0][0], 2, 2 );
printf( "\nPrinting 2x3 matrix\n" );
print( &test23[0][0], 3, 2 );
printf( "\nPrinting 3x3 matrix\n" );
print( &test33[0][0], 3, 3 );
printf( "\nPrinting 2x4 matrix\n" );
print( &test24[0][0], 4, 2 );
return 0;
}