**New course!**Every coder should learn

**Generative AI!**

+ 11

# Number of dimensions of multi-dimensional array in C?

Assume that a multi-dimensional array of integers is passed to a function in C. I would like to determine by the function how many dimensions this array in C has. Is this even possible without passing the number of dimensions to the function? The array should have an arbitrary number of dimensions. As a secondary question: Is there a limit of dimensions in an array?

1 Answer

+ 5

I also don't think there is a limit to the number of dimensions apart from memory limits. In general anything more than 3 or 4 dimensions is not common.