Lie*_*mai 1 c++ memory
当我在函数中声明变量时,我正在使用一些内存.当函数完成它的工作时,内存是否被释放?
Luc*_*ore 6
当超出范围时,将释放所有自动存储变量,并且您必须明确动态分配的变量:
void foo() { int x; int* y = new int; //You get a memory leak with each call to foo without the following line delete y; } //x is freed here
归档时间:
12 年 前
查看次数:
128 次
最近记录: