int main(){
(int*) pointer = (int*) malloc(sizeof(int));
free(pointer);
}
I learned from 'Prata, Stephen. C Primer Plus (Developer's Library)' that "When the function terminates, the pointer, being an automatic variable, disappears." so simply, i don't need to null the pointer
however, I also learned from school that the pointer becomes a dangling pointer if it doesn't get nulled after it free.
Two ideas are contradicting each other. Which one is the right one?