求大神解答个问题,一直搞不懂
#include<stdio.h>void main()
{
char *str = (char *) malloc(100);
strcpy(str, "hello");
free(str); //这个语句的作用是把str删除吗?
if(str != NULL) //如果str已经被删除,那为什么结果会输出"world"?
{
strcpy(str, "world");
printf("%s\n",str);
}
}
2011-03-21 15:50
2011-03-21 16:05
2011-03-21 16:06
2011-03-21 16:07
2011-03-21 16:10
2011-03-21 16:12
2011-03-21 16:17
2011-03-21 16:18
2011-03-21 16:19
2011-03-21 16:24