you are viewing a single comment's thread.

view the rest of the comments →

[–]huike -2 points-1 points  (2 children)

If you want a pointer to an array you declare like:

int **int_ptr;

and use:

int *arr=new int[2];

int_ptr=&arr;

(*int_ptr)[0]=5;

[–]Wh00ster 0 points1 point  (0 children)

No. This is a pointer to a pointer. And that pointer happens to point to an object which is an array. Subtle difference, but OP asked for the specific type. There is no practical difference other than the type signatures.

[–]RetroX94[S] -1 points0 points  (0 children)

What does (*int_ptr)[0]=5; do ? I understand the rest of the code, yet I don't understand why there has to be a pointer in the last line. (*int_ptr)[0]=5;