[prev] [index] [next]

3d Arrays

Arrays can be declared with more than two dimensions, e.g.

int cube[10][10][10];     // 3 dimensional
int hyper[4][5][6][7];    // 4 dimensional

The definition of cube can be interpreted as:

  • cube is an object containing 10 elements
  • each element is a 10×10 matrix
  • each matrix contains 10 rows
  • each row contains 10 int variables
  • cube contains a total of 10×10×10 = 1000 int variables