Answer the question
In order to leave comments, you need to log in
What happens to memory?
Is there a function that returns a pointer to an array, after it has completed, the memory itself will be released?
char* func()
{
char* arr = (char*)malloc(100);
//
//
return arr;
}
Answer the question
In order to leave comments, you need to log in
Of course not.
The memory will hang in the "busy" heap until someone calls free() on it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question