C++ 中 定义变量和new的区别是什么?
以下2行代码有什么区别?内存分配方式是怎样的?
int i; int * i1 = new int;
前者定义在堆栈上,不需要手工释放后者在堆(heap)上分配,需要自己释放