// The following program works only if your compiler is C99 compatible.
#include <stdio.h>
// m and n must be passed before the 2D array
void print(int m, int n, int arr[][n])
{
int i, j;
for (i = 0; i < m; i++)
for (j = 0; j < n; j++)
}
int main()
{
int arr[][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
int m = 3, n = 3;
print(m, n, arr);
return 0;
}
Ly8gVGhlIGZvbGxvd2luZyBwcm9ncmFtIHdvcmtzIG9ubHkgaWYgeW91ciBjb21waWxlciBpcyBDOTkgY29tcGF0aWJsZS4KI2luY2x1ZGUgPHN0ZGlvLmg+CgovLyBtIGFuZCBuIG11c3QgYmUgcGFzc2VkIGJlZm9yZSB0aGUgMkQgYXJyYXkKdm9pZCBwcmludChpbnQgbSwgaW50IG4sIGludCBhcnJbXVtuXSkKewogICAgaW50IGksIGo7CiAgICBmb3IgKGkgPSAwOyBpIDwgbTsgaSsrKQogICAgICBmb3IgKGogPSAwOyBqIDwgbjsgaisrKQogICAgICAgIHByaW50ZigiJWQgIiwgYXJyW2ldW2pdKTsKfQoKaW50IG1haW4oKQp7CiAgICBpbnQgYXJyW11bM10gPSB7ezEsIDIsIDN9LCB7NCwgNSwgNn0sIHs3LCA4LCA5fX07CiAgICBpbnQgbSA9IDMsIG4gPSAzOwogICAgcHJpbnQobSwgbiwgYXJyKTsKICAgIHJldHVybiAwOwp9