16,471
社区成员
发帖
与我相关
我的任务
分享
int RetValue()
{
int ret=10;//栈上分配ret=10;
return ret;//将栈上的ret的值用相当于memcpy的方法copy到主函数中栈上的iRet
} //释放ret,这段栈内存回收
int main()
{
int iRet=0; //栈上分配iRet为0
iRet=RetValue();//得到RetValue的返回值
} //iRet被回收清理