I wrote the following code declaring an array of 5 pointers to int and then a pointer to the address of the mentioned array:
int* arr[5];
int** p=&arr;
At compilation with gcc, I get the following warning:
initialization from incompatible pointer type [-Wincompatible-pointer-types] int** p=&arr;
Why is int** p
the wrong pointer type, isn't &arr
a pointer to a pointer to an int
?
Many thanks.