C code:
#include<stdio.h>
#include<stdlib.h>
typedef struct MyNode
{
int v;
struct MyNode * next;
}Node;
void main()
{
Node * h1, *h2, *h3;
h1 = malloc(sizeof(Node));
h2 = malloc(sizeof(Node));
h3 = malloc(sizeof(Node));
printf("%X/t%X/t%X/n", h1, h2, h3);
free(h1);
free(h2);
free(h3);
h1 = h2 = h3 = NULL;
}
Running result:
430070 430030 431E90
看到了吧,地址由大变小,又由小变大,而且地址间的差距无法预料。如果你输出十几个,也许你会找到一点点的规律吧!