Vectors are new to me and I am having a hard time finding documentation on how to use them. I am also wondering how to use their iterators.
So my goal is to create a vector (essentially a dynamic array) of references/pointers of type Account. I then need to have insert/remove and find functions (presumably using an iterator) for the vector.
There's documentation for it. The methods you're looking for is push_back(), remove(), and to find something you'll need to write your own function for that.
Here's documentation on iterator. Gotta be careful using iterator with vector, whenever it resizes any pointers you have to that vector (ie iterators) could become invalidated and you'll need to reset them.
Yeah, I was playing around with std::vector<Account*> and that seems to hold the pointers to Account just fine but then how do I implement random access. I am getting stuck with this-> or * or & and how I can implement things like find.
Would it look like