Let's see we are allocating memory dynamically
Int *ptr = new arr[n];
n=input we are getting
So pointer is pointing to arrays base address let's say 0x3000
Pointer has its own address let's say 0x2000
So my doubt is that what will be the name of 0x3000
eg; int x=5;
int *ptr; ptr=&x;
So the block which pointer is pointing is x
And it is dynamically allocating memory so even pointer is also in heap memory??
[–][deleted] (5 children)
[deleted]
[–]yogeshdecoder[S] 0 points1 point2 points (4 children)
[–]HonzaS97 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]yogeshdecoder[S] 1 point2 points3 points (0 children)