Home > Back-end >  The release of the heap
The release of the heap

Time:10-26

About the malloc and free to use, for example:

Char * m * n;
M=(char *) malloc (sizeof (char));
N=m;
Free (n);
I do not know whether m, pointing to the pile will be released do hope who can help me explain

CodePudding user response:

No problem, even if no matter distribution release mechanism of the pile, the most direct from free function parameters can judge out
As a result of the m and n values are equal, all passed to free the values of the parameters is the same, for free function, no difference

CodePudding user response:

Oh thank you

CodePudding user response:

M, pointing to the pile will be released, because the two are the same
  • Related