Thanks everybody, I appreciate the insight/advice. I am not very familiar with using STL containers, so this is quite the learning curve. :)
“... how I would access each vector
I assume you mean, each vector element?”
Ganado, yes, that’s exactly what I meant, thank you for clarifying.
“'Tacos, If this is going to involve dynamic memory... maybe tell us what you want to do exactly before you design an out of control monster... :)”
Jonnin,
So, the example I used was intended to help me understand how I would go about this using something simple like integers. In my actual project, I would be passing in an object by reference. Without getting bogged down by details, I had a project for school that I partially completed by the due date. Now that the due date has passed, I wanted to go back and work on this as an exercise (just for my own edification).
Regarding using dynamic memory: In other parts of my project where I used a vector pointer, I added an iterator to my destructor to deallocate the memory. I have not attempted this yet with a vector of queue pointers, so I’m not entirely sure of how I’m going to approach it. This is how I did it in other parts of my project. Example where vector is of type, "Sports", and called "teams", my destructor would contain the following:
1 2 3 4 5
|
for(vector<Sports*>::iterator it = teams.begin();it != teams.end(); it++)
{
delete *it;
}
|