I'm having a problem with copying vectors. So I have this vector of objects call it std:: vector<parent*> first_vector. parent is the base class. The problem is I want to create a seperate vector std::vector<parent*> second_vector that gets all the information copied from first_vector.
The problem is when I copy it like this
second_vector = first_vector;
it copies only the adress of the pointers in first_vector so when I change one it changes the other. How do I deep copy vector with pointers such that they are independant? Let me know if I need to be more specific.