#include <stdio.h>
#include <stdlib.h>
typedef struct node{
struct node *pre;
struct node *next;
int data;
}NODE; //struct declaration
int main(){
NODE *new_node=(NODE*)malloc(sizeof(NODE)); //memory allocation
printf("\nnew_node addr: %d\n",new_node);
free(new_node); //deallocation
printf("new_node addr: %d\n",new_node);
}
Run Code Online (Sandbox Code Playgroud)
结果:
new_node addr: 2097152
new_node addr: 2097152
Program ended with exit code: 0
Run Code Online (Sandbox Code Playgroud)
结果为何相同?
我释放new_node的内存.但是new_node有地址.
为什么??