上古世纪原木采集点:结果分析............

来源:百度文库 编辑:神马品牌网 时间:2024/05/15 13:03:18
void GetMemory(char *p)
{
p = (char *)malloc(100);
}
void Test(void)
{
char *str = NULL;
GetMemory(str);
strcpy(str, "hello world");
printf(str);
}
请问运行Test 函数会有什么样的结果?
程序无法运行,大家可以试一下...

hello world

100个字符长度 hello world后面是乱码