P
pratap
how could i find out how much memory is blocked(or has been allocated
to a pointer)
consider,
int *p=new int;
or
int *p=new int[100];
suppose i dont know the right hand side of the statement i.e.
new int or new int[100] or new int[n] (where n is calculated during
runtime)
(definitely sizeof(p) would not give me the amount of memory
allocated.)
i would be interested in knowing the amount of memory taken up by the
respective pointers in a program. how could i possibly achieve this?
Are there any methods or standard routines to measure the amount of
memory?
If there are no standard methods or routines why would this be so ?
to a pointer)
consider,
int *p=new int;
or
int *p=new int[100];
suppose i dont know the right hand side of the statement i.e.
new int or new int[100] or new int[n] (where n is calculated during
runtime)
(definitely sizeof(p) would not give me the amount of memory
allocated.)
i would be interested in knowing the amount of memory taken up by the
respective pointers in a program. how could i possibly achieve this?
Are there any methods or standard routines to measure the amount of
memory?
If there are no standard methods or routines why would this be so ?