代码如下:
#include <stdio.h>
#include <stdlib.h>
struct test
{
int a;
struct test *next;
};
int main()
{
struct test test0={10};
struct test *test1 = (struct test *)malloc(sizeof(struct test));
test1->a=20;
test1->next = &test0;
free(test1);
printf("%d %d",test1->a,(*test1->next).a);
}
输出test1->a为0 ,(*test1->next).a为10
蝴蝶不菲
皈依舞