1

伪代码:

int n;
cin>>n;
int ar[n];

为什么这没有给出错误?如果允许这样做,为什么我们需要 new 和 delete 运算符?我能想到的唯一区别是 new 将在堆中分配内存,这将在堆栈中分配内存。

4

0 回答 0