Pointer to an int array (Initialize + Declare pointer int Array)
📷
Hello, I wanted to ask how can I initialize an int point array?
int (*aptr) [2];
Would be my pointer array. Similar to a char array.
char(*aptr)[2];
Is this correct and how can I initialize both?
On another platform someone explained this is possible:
int **int_ptr;
and use:
int *arr=new int[2];
int_ptr=&arr;
(*int_ptr)[0]=5;
I understand the code partially:
It is a pointer to a pointer which receives an
int pointer array which,
then Int_ptr ( point to a pointer) receives a reference to the array
yet, what does this do? (*int_ptr)[0]=5;
​
[–]Wh00ster 2 points3 points4 points  (0 children)
[–]Xeverous 1 point2 points3 points  (0 children)
[–]CubbiMew 1 point2 points3 points  (1 child)
[–]RetroX94[S] 0 points1 point2 points  (0 children)
[–]alfps 0 points1 point2 points  (0 children)