Multidimensional arrays in C: How to pass a multidimensional array to functions?

General form of a multidimensional array:

type name[Size1][Size2]. . .[SizeN];

Arrays for more than three dimensions require too much memory and hence they are uncommon. To pass a multidimensional array to functions:

For an array:

int a[6][5][8][10][23];

Function that receives a will be declared as:

function1(int a[][5][8][10][23])




Here, you can see all indexes are declared but not the leftmost one.

Leave a Reply