My problem is the following: I want to give the function my matrix (2D array) but in fact I have tried a lot to achieve this but I missed the point with every try. I just found solutions were the function head should be changed but that's exactly what I want to avoid.
So my function is this:
void print_matrix(int **const mat, int n) {
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++){
printf("%d ",mat[j][i]);
}
printf("\n");
}
}
And my call looks like this:
(I want to change just the call of the function not the declaration of the array_a
)
int array_a[4][4];
print_matrix(array_a, 4);
or
print_matrix(&array_a, 4);
or
print_matrix(**array_a, 4);
and so on..