I have to call a function which passes 2d array as argument. Function call:
int n;
char ch;
cin>>n;
bool b[n][n];
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cin>>ch;
if(ch=='X'){b[i][j]=1;} //reads input from a file
}
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<evaluate(n,b, i, j); //shows error no matching function for call to evaluate
}
cout<<endl;
}
However,it displays an error no matching function to the call Here's my function evaluate's declaration:
int evaluate(int n,bool** b,int x,int y){
//body
}
I have tried variations in function declaration as:evaluate(int n,bool b[n][n],int x,int y); but it gives the same error. Also on removing the 2d array argument,the function works. Please suggest what my mistake is.