No one has been able to answer this yet!!
Hi, I haven't been able to find a satisfactory answer yet!, but what would this code do?
So I guess the idea is , what happens to "p" at the termination of the function call? since its a stack variable, it gets popped, but the malloc'd memory is on the heap, which still persists, I think? and since you're returning the dereferenced variable, it should be good, right?
a = foo();
p = malloc(1*sizeof(int));
*p = 5;