char a2D[10][5];
memset(a2D, 0, sizeof(a2D));
int b2D[5][5];
memset(a2D, 0, sizeof(b2D));
int b3D[5][5][5];
memset(b3D, 0, sizeof(b3D));
Though the following also work for declaration
1 2 3 4 5
char a2D[10][5] = {0};
int b2D[5][5] = {0};
int b3D[5][5][5]= {0};
But you still need the memset approach to reset the arrays back to zero.
Andy
PS (The following definitely holds for vc++, as is prob true for other compilers) If you set a breakpoint on a line like int b2D[5][5] = {0}; and look at the disassembly, you'll find it's calling memset in most cases. The exceptions seem to be very small structs, like class Point(int x; int y;}; where it just sets the two values to zero. So there's no performance difference between the two approaches for non-tiny arrays.