Passing a 2D array to a function along with its size

i want to pass a 2D array to a function but it shows error while passing it
it allows only when we make the size of array fixed
the constraints were quite big
so i couldn’t make an array of a big size
long long dp[5001][10000007]
so i took m and n
but it shows error

plz help me in this.

Thanks