its a question from a test:
i was asks what what1(arr,6,5) expression will return
??
arr is a 2D array which looks like this:
0 1 1 0 1
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
1 0 0 1 1
1 0 1 1 0

Code:
int what1(int **arr, int m, int n){
int i, j, tmp, stam=0;

for(i=0; i<m; i++)
for(j=0; j<n; j++){
   tmp = what2(arr,i,j,m,n);
   if (tmp>stam) 
         stam = tmp;
}
return stam;
}

int what2 (int **arr, int row, int col, int m, int n){
int i,j,tmp, stam=0;

if (row < 0 || row >= m || col < 0 || col >= n) return 0;
if (arr[row][col] == 0) return 0;

arr[row][col] = 0;
for(i=-1; i<2; i++)
	for(j=-1; j<2; j++){
		if(!i && !j) continue;
tmp = 1 + what2(arr, row+i, col+j, m, n);
		if (tmp > stam)  stam = tmp;
	}
arr[row][col] = 1;

return stam;
}
why it passes the arr as
what1(arr,6,5) instead of what1(&arr,6,5)

can i do arr[0][0] = 0; for arr
if arr is passed instead of &arr
will it save the change after the function ends??

what2
has that line
Code:
arr[row][col] = 0;
and i cant decide what happens at the beginning when arr[0][0] = 0;
because arr is passed not &arr
so the change which that line will make
will not exist after what2 ends
??