J
Jamil Anwar Zaman
If I dynamically allocate memory to a pointer, then is it possible to see
afterwards what is the memory size the pointer is looking at.
e.g
int SIZE = 10;
int *a = malloc(SIZE*sizeof(int));
printf("Size : %d", sizeof(a));
this actually gives me 4 bytes, which essentially is the sizeof the
pointer. But I want to know the actual memory size. Any idea how can I do
that.
afterwards what is the memory size the pointer is looking at.
e.g
int SIZE = 10;
int *a = malloc(SIZE*sizeof(int));
printf("Size : %d", sizeof(a));
this actually gives me 4 bytes, which essentially is the sizeof the
pointer. But I want to know the actual memory size. Any idea how can I do
that.