Possible Duplicate:
Is 2d array a double pointer?
void fun(int **ptr,int n)
{
int i=0;j=0;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
printf("%d ",a[i][j]);
}
Int main()
{
int arr[20][20];
int **ptr=arr; //Statement 1
fun(arr,20);
}
Why does statement 1 give a warning and the function call doesn't? I saw that this is an exceptional case in function calls. Is there a reason behind this? How does the 'arr' a pointer to an array becomes a double pointer 'ptr' and still we can use it like a pointer to an array? Thanks in advance.