3 ms·
I'm not sure. I only started learning C around 1991. I could see how you might still have to work around using the arrays. "a[4][4]" as an example allocates me
by drivers99 10y ago
I'm not sure. I only started learning C around 1991. I could see how you might still have to work around using the arrays. "a[4][4]" as an example allocates memory contiguously, but if you pass a pointer to a, you lose the dimensionality (it's more like "a[16]"). So you'd have to have some other way to pass the dimensions in and you'd have to calculate the location of elements yourself. Otherwise, you'd have to pass it by value (if the dimensions are known at compile time and don't change) which can be very inefficient (copying large blocks of memory). I thought maybe you were getting at that when you said C doesn't "really" support it. The more I look into how to pass a multi-dimensional array around in C, the more I think you are more right than I was. It doesn't really have it, it's more like a "recursive use of the type system" as one link was explaining it.