Passing 2D array to a function as parameter

#include
using namespace std;
int escapePark(char** park,int n,int m,int k,int s,int i,int j)
{
if(s<k)
return -1;
if(i==n)
return s;
if(j==m)
{
s++;//because going to next row is lossless.
return escapePark(park,n,m,k,s,i+1,j=0);
}
if(park[i][j]==’.’)
{
s=s-3;//2 due to β€˜.’ and 1 to take next step
return escapePark(park,n,m,k,s,i,j+1);
}
if(park[i][j]==’’)
{
s=s+4;//+5 due to '
’ and -1 to take next step
return escapePark(park,n,m,k,s,i,j+1);
}
if(park[i][j]==’#’)
{
return escapePark(park,n,m,k,s,i+1,0);
}
}

int main() {
int n,m,k,s;
cin>>n>>m>>k>>s;
char park[n][m];
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
cin>>park[i][j];

int remain=escapePark(park,n,m,k,s,0,0);
if(remain==-1)
	cout<<"No";
else
	cout<<"Yes"<<remain;
 
return 0;

}

this is my code for magic park problem, I am getting a type casting error but not understand how to solve it.
Also, every time I send such 2D arrays of undefine dimension as parameter I always got the same type of error. So, besides declaring array globally or taking a fixed-size array, please solve it by passing parameters it will help in other 2D array passing problems.

See this is how you pass when you know the parameters https://ide.codingblocks.com/s/258117
For the rest please see this article https://www.geeksforgeeks.org/pass-2d-array-parameter-c/

at end of function you added return 0; to resolve warning of reaching end of non-void function but I include all the cases so that it return before reaching end

The thing is you need to write an else statement then, because although your code logic won’t reach the end of the function but still compiler doesn’t know that and forms all possible workflows.
So what if all the if’s fail?
If you are very confident then you can write your code like this https://ide.codingblocks.com/s/258398