测试吼什么结果??为什么??

来源:百度知道 编辑:UC知道 时间:2024/05/25 01:10:51
#include<isotream.h>
using nanmespace std;
{char p[]="hello world";
return p;
}
int main()
{char *str=NULL;
str=GetMemory();
cout<<str;
return 0;
}

可能是乱码,也可能是正常输出,因为GetMenory返回的是
指向“栈内存”,该指针的地址不是NULL,但其原来的内容
已经被清楚,新内容不可知。

测试内存