Chan Kevin Guy Kim
2003-12-09 19:14:53 UTC
if i wrote something like...
void main(void)
{
int *array;
array=(int*)malloc(sizeof(int)*10);
array=&array[5];
free(array);
}
would the first 5 nodes (that were allocated before) not be
freed? or would free() know to free 10 allocated spaces?
void main(void)
{
int *array;
array=(int*)malloc(sizeof(int)*10);
array=&array[5];
free(array);
}
would the first 5 nodes (that were allocated before) not be
freed? or would free() know to free 10 allocated spaces?