I have a c function receiving pointer of array as its one parameter.
Since pass an array is actually the pointer of its first element, so the pointer of an array should be a pointer of pointer.
int arr[]={0,1,2,3};
int main(){
receiveArray(arr);
receiveArrayPtr(&arr);
}
int receiveArray(int *arrPara){....}
int receiveArrayPtr(int **arrPtrPara){....} //Why cannot do this?
The Error message is
"expected ‘int **’ but argument is of type ‘int ()[4]’
void receiveArrayPtr(int*);"
Wish to know why
int **p;
: type of*p
isint *
but address of array top isint
value of0
, not pointer toint
. – BLUEPIXY