(1) How to correct the below dynamic mem allocation of 4 integer pointers
int *p[4];
p = (int* [])malloc(4*sizeo f(int*));
(2)
int x = 10, y = 30, z=40;
p[0] = &x;
Quest:
Pointer p[0] (in heap memory) contains the address of x which is allocated in the data memory/segment. So is it possible to hold data memory/segment address in a heap memory pointer.
int *p[4];
p = (int* [])malloc(4*sizeo f(int*));
(2)
int x = 10, y = 30, z=40;
p[0] = &x;
Quest:
Pointer p[0] (in heap memory) contains the address of x which is allocated in the data memory/segment. So is it possible to hold data memory/segment address in a heap memory pointer.
Comment