First, a quick re-write of your "spec". (I'm assuming this is what you meant.)

a1

**[** a2[ b1 ]

**]** **[** a3[ ax1[ b2 ] ] [ ax2[ b3 ] ] [ ax3[ b4 ] ]

**]**
a1 - 2D array

a2 - 1D array within a1

a3 - 3D array within a1

ax1/2/3 - 1D arrays within a3

b1/2/3/4 - indices

Exactly what you have will work just fine, except that it is not correct to say that a2 and a3 are "within" a1. They are simply being used as indices for a1.

If that is not what you mean, then I agree with xpi0t0s that your "spec" makes very little sense. If a1 is 2D, it needs two indices. Where are they if they aren't a2 and a3? The same for a3: if ax1/2/3 aren't its indices, then where are its indices?

If you really want the "sub-arrays" to be "within" other arrays, xpi0t0s has demonstrated the polymorphic version. Another version is something like this (with 5 as an arbitrary size):

Code:

struct {
int a2[5];
struct {
int ax1[5];
int ax2[5];
int ax3[5];
} a3[5][5][5];
} a1[5][5];
// Access is like this:
a1[2][4].a2[1] = 1;
a1[2][4].a3[3][2][0].ax1[1] = 2;