Board index » delphi » pointer to an array of pointers

pointer to an array of pointers

hi,
ive got al ittle problem concerning arrays. the point is , that i have to
declare a pointer to an array consisting of pointers, but icannot figure out
how that declaration has to look like. i just realized that int **array[] is
not a solution, as it declares a pointer to a pointer to an array consisting
of ints. how has the declaration to look like that it makes it really a
pointer to an array consisting of pointers to ints?
thanks and greetings
michael
 

Re:pointer to an array of pointers


Quote
"Michael Beer" <ixtys...@web.de> writes:
> ive got al ittle problem concerning arrays. the point is , that i have to
> declare a pointer to an array consisting of pointers, but icannot figure out
> how that declaration has to look like. i just realized that int **array[] is
> not a solution, as it declares a pointer to a pointer to an array consisting
> of ints.

Actually, it declares an array of pointers to pointer to int. If you look
at a table showing operator precendes, you'll notice that [] precedes unary *.

Quote
> how has the declaration to look like that it makes it really a
> pointer to an array consisting of pointers to ints?

Let's develop it; the problem to overcome is operator precedence, again.

int array_of_ints[10];

int *array_of_pointers_to_int[10];

int *(*pointer_to_array_of_pointers_to_int)[10];

Other Threads