Hacker News new | ask | show | jobs
by AaronBallman 2250 days ago
You couldn't in that parameter order. However, you could do this: int f(size_t n, int a[n][n]) { return a[n-1][n-1]; }

(https://godbolt.org/z/DV9c-C)

Btw, that definition was obsolescent in C89 too.

1 comments

Well, yes. But putting the array argument(s) first is the more natural order, in my opinion. And it is surely odd that only one order is allowed in this context, when otherwise C is happy with changing the order of parameters to be whatever you like.

Plus, of course, there may be existing code using such functions, with parameters in the order that would become impossible if this syntax were disallowed.