I'm writing a code to find the shortest path through a maze using djikstra's algorithm.
When I pass my array I'm getting the
warning "passing argument 1 of 'traverse' from incompatible pointer type"
expected 'int (*)[(sizetype)(n)]' but argument is of type 'int **'
I had originally initialized and allocated my matrix in main here:
int **mat;
mat = (int **)malloc(sizeof(int *)*n);
for(i=0; i<n; i++){
mat[i]=(int *)malloc(sizeof(int)*n);
}
And I'm creating a function by
void traverse(int mat[n][n], int src){
I then call this function in main here
traverse(mat, 0);
I'm sure it's a problem with passing an array as a pointer, but I'm not too familiar with the rules here. Any help is appreciated.