I have a function like this:
void findScarf1(bool ** matrix, int m, int n, int radius, int connectivity);
and in main . I am creating a 2d dynamic array to pass in this function
bool matrix[6][7] = { {0, 0, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 1, 1, 1, 0, 0} };
The problem is this:
findScarf1(matrix, 6, 7, 3, 4);
causes error C2664: 'findScarf1': cannot convert parameter 1 from 'bool [6] [7]' to 'bool **'
How to initialize an array compactly (simultaneously with a declaration)?
ps sorry if it duplicates the question, but I spent 1.5 hours on this.