All we know malloc return the start address of allocated memory block but I would like how do I count end address of this block
int *p, *q;
p=malloc(4*sizeof(int));
q=p+4;
Now q
will be pointing to end address block but I would like to have some other approach to get end address of memory block allocated by malloc.
Edit
One more thing I would like know here is there way to make sure that we are at end of allocated block