vectors

So I'm learning about vectors and multi-dimensional vectors, and I have a question pertaining to the use of dynamically allocated vectors.

Before I was working with something along the lines of

1
2
  int arraysize = 10;
  int* arrayname = new int[arraysize];


This would basically create a int arrayname[10];, but on the heap instead of on the stack. Since using this method is on the heap, I would have to de-allocate it and its pointer when I was done using it by using
1
2
delete [] arrayname;
arraysize = nullptr;


My question : Now that I'm using vectors, How is the data being stored, and do I need to de-allocate everything when finished using them (if so how?)?
If you mean std::vector<int> then you don't have to.
Topic archived. No new replies allowed.