c++memorydynamicvectorallocation

C++ Dynamically allocated std::vector


I'm a C++ newbie and I am working on university project Driver Book in C++. I am using vector for the first time and I would like to make it work with dynamic memory allocation.

I have vector declared like this:

vector <item> book;

What is needed to make it work with dynamic memory allocation?

Thanks in advance.


Solution

  • Done. vector already internally dynamically allocates when you push_back into it.