Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
伪代码:
int n; cin>>n; int ar[n];
为什么这没有给出错误?如果允许这样做,为什么我们需要 new 和 delete 运算符?我能想到的唯一区别是 new 将在堆中分配内存,这将在堆栈中分配内存。