C++创建对象的三种方法

我自己经常弄混

A a(1); //栈中分配
A b = A(1); //栈中分配
A* c = new A(1); //堆中分配

猜你喜欢

转载自www.cnblogs.com/1Kasshole/p/9135503.html