[求助]一个看似没错却出错的程序
#include<stdio.h>#include<string.h>
char *str = NULL;
void hello()
{
char p[20] = "helloworld";
str = p;
}
void main()
{
hello();
printf("%s",str);
}
编译没问题
但结果却是乱码,为什么?大家指点一下,谢谢
2007-01-09 13:42
2007-01-09 14:44