0

I followed Ancient Dragon's advice and used vectors to store roughly 1000 objects in a program I have written. Unfortunately, the vector library is not one I am familiar with. I read through the information at http://www.cppreference.com/cppvector/index.html. It seems getting a reference to each element of the vector is the only way to access them... is this correct? Or could I do something as follows:

vector<Thing> things;
//put objects in the vector
things[2].doStuff;

If this is not possible how would I go about accessing the data? Thank you :)

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by dmanw100
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.