I'm curious to know what happens if you declare an int pointer inside a function, and then dynamically allocate it using malloc
void testing(){
int *p = malloc(sizeof(int));
*p = 5;
}
Does the data (5 in this case) live on in the heap even though the pointer is destroyed after the function is finished executing?