c++ stl库容器有动态内存分配吗?

The c ++ stl library containers have dynamic memory allocations?

我想知道例如如果动态分配内存我在std::vector中使用new []或malloc,或者不需要,如果我不需要,我应该在哪里使用new [],malloc和智能指针?

如果你使用c++,你最好使用new[]方法在堆中分配内存,因为它比malloc方法更安全。