R
Ramki
How does free() , delete() works?
If we allocate memory using the following statement
int *p = malloc(100*sizeof(int));
Inorder to release the memory we will call '"free(p) "
How does it know about how many bytes/bits to be deleted?(same is the
case with new and delete statements)
As far as i know, the information about this will be stored in the
previous byte of the begining of block which is allocated using
malloc()
Do anybody know more about this??
Thanx,
Rama
If we allocate memory using the following statement
int *p = malloc(100*sizeof(int));
Inorder to release the memory we will call '"free(p) "
How does it know about how many bytes/bits to be deleted?(same is the
case with new and delete statements)
As far as i know, the information about this will be stored in the
previous byte of the begining of block which is allocated using
malloc()
Do anybody know more about this??
Thanx,
Rama