I'm trying to run my code but I get 5 errors and they're all of the same kind. The first is:
note: expected 'int (*)[3]' but argument is of type 'int'
In, for example, this part of my code (it points out on the line where you see the word HERE
HERE-> int isNeighbourClose(int mat[N][M], int i, int j, int a, int b){
int m;
m=calcDistance(mat[i][j], mat[a][b]);
if(m<=1)
{
return 1;
}
return 0;
}
And the other is:
error: passing argument 1 of 'isNeighbourClose' makes pointer from integer without a cast
In, for example, this part of my code
int isCellExtreme(int mat[N][M], int i, int j){
int a, b;
int m;
for(a=-1;a<=1;a++)
{
if((i+a>=0) && (i+a<=N))
{
for(b=-1;b<=1;b++)
{
if((j+b>=0) && (j+b<=M))
{
if((a!=0)||(b!=0))
{
HERE-> m=isNeighbourClose(mat[N][M], i, j, i+a, j+b);
if(m)
{
return 0;
}
}
}
}
}
}
return 1;
}
I went over this a couple of times and can't find where the problem is. Any idea where I'm mistaken?
Thanks in advance.
isCellExtremetom=isNeighbourClose(mat, i, j, i+a, j+b);and see if that works better.