64,683
社区成员
发帖
与我相关
我的任务
分享
#include "iostream"
#include "string"
using namespace std;
char *GetMemory( void )
{
char p[] = "hello world";
return p;
}
void Test( void )
{
char *str = NULL;
str = GetMemory();
cout<<*(str+6)<<endl; //这里可以遍历hello world这个字符串
}
int main(void)
{
Test();
system("pause");
return 0;
}