Advertisement

Object Management

Started by September 19, 2002 04:48 PM
1 comment, last by Zorbfish 22 years, 1 month ago
Linked Lists, Arrays, Vectors? I know these are just a few but they are some of the more common ones. Im trying to decide what to use to hold a list of all my current objects. For instance Im writing a class of code for class that will hold all my direct draw surfaces in a list of some sort. Personally I was thinking the vector would be alright seeming as how I dont plan on having a huge amount of surfaces. Any opinions on this subject are welcome and dont be afraid to put me in my place if you think Im really wrong lol.
vector will do

My compiler generates one error message: "does not compile."
My compiler generates one error message: "does not compile."
Advertisement
Hey, great question.
I say that because I'm making a linked list manager class in my c++III class. After looking at all the different kinds of list, they are all basically the same. The differences are in speed, size, and how easy it is to get to the stuff in the middle. Arrays are good if the size never changes, like if you always know you're going to have 5 and only 5 surfaces, just use a regular array and bee done with it. But if the number of objects in the list are ever changing, I'd also go with a vector.
Believe me, after trying to code my own list, a vector is the way to go. Learning to use it can be a pain, but all the STL container classes seem to operate the same.

For anyone else reading this, if I've said anything that is wrong, you can put me in my place too.

Hope this helps...

I think, therfore I am.
I think?

[edited by - glass_knife on September 19, 2002 9:22:32 PM]

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

This topic is closed to new replies.

Advertisement