How do you implement the copy and erase functions for the STL for the vector.h file? And also for the vector.cpp file? I am lost. Please help.
How do you implement the copy and erase functions for the STL for the vector.h file? And also for the vector.cpp file? I am lost. Please help.
>How do you implement the copy and erase functions for the STL for the vector.h file?
Um...however you want. If you're writing a vector class then it's up to you how to do it and depends heavily on the underlying structure of the vector. If you're not writing your own vector class then you need to be more specific as to what you want.
-Prelude
My best code is written with the delete key.
Post an example of your problem.
Kuphryn
I don't think you can implement copy and erase with vectors. At least I've never done it.
why not use pop_back and push_back?
sorry, found erase:
erase(): This function erases element from the vector.
I'll look for copy