首页 新闻 会员 周边

萌新求问 在循环中分别调用有new 和 delete的方法 物理内存一直涨

0
[已关闭问题] 关闭于 2022-01-13 11:06

include "stdio.h"

void ff1(float *tt, int cc)
{
tt = new float[cc];
}

void ff2(float *tt)
{
delete[] tt;
}

int main()
{
int cc = 100000;
int y = 0;
float *tt = NULL;
while (1) {
ff1(tt, cc);
y++;
Sleep(500);
ff2(tt);
if (y > 50) break;
printf("%d ", y);
}
return 0;
}

About。M的主页 About。M | 菜鸟二级 | 园豆:202
提问于:2022-01-13 10:02
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册