moteutsch moteutsch - 28 days ago 5x
C Question

Pointer to Array of Pointers

I have an array of int pointers

int* arr[MAX];
and I want to store its address in another variable. How do I define a pointer to an array of pointers? i.e.:

int* arr[MAX];
int (what here?) val = &arr;


Should just be:

int* array[SIZE];
int** val = array;  

There's no need to use an address-of operator on array since arrays decay into implicit pointers on the right-hand side of the assignment operator.