This question tells me that I can specify an array of a certain size as a parameter in C. I would presume that this extends to matrices (?) so that I can specify
void foo(char (*p)[10][2]);
to force the caller to pass a 10 by 2 matrix. What I would really like to do is to achieve the following behaviour (using the deliberately dodgy syntax to describe what I want):
void foo(char (*p)[][2]);
That is, does C provide a way of forcing the caller to pass an n by 2 matrix at compile time?
For context, I have a load of {x,y}
data points that I process, which are of varying size. I therefore know there should always be 2 elements in each row and I'd like to check for this at compile time if possible, regardless of the number of rows.