STL List class and pointers

I am using a list for my data. Is there a way to set a pointer to the beginning of the list?? Thanks!!
get an iterator using mylist.begin();
But I also have to be able to set a pointer equal to a node in the middle of the list. That way I can traverse backwards through the list in a tree fashion. Thanks!!
Then why not use a vector<> ?
http://www.sgi.com/tech/stl/Vector.html

You can return an interator, then increment it as much as required to find the element you want. http://www.sgi.com/tech/stl/List.html
Because the program is doing a breadth-first search and depth-first search and will take up so much memory, a vector will crash. I actually had a vector implemented, but then switched to a list. The only problem is being able to go straight to a point in a list without iterating from the beginning. I wish I could use a vector, but space/memory becomes an issue. Thanks!!
I fail to see how a vector is going to use significantly more space than a list?
doesn't a vector keep all data in one memory slot, whereas a list can have memory located in several places with pointers connecting???
Just store pointers in it then, instead of whole objects.

or use http://www.sgi.com/tech/stl/Deque.html
Ok, that helps. However, just found the actual error, turns out it was a memory/space issue. It was stupidity on my part. But at least I found the error. Thanks for your help Zaita and sorry that you had to try and figure out my stupidity. Thanks!!!
No worries :)
Topic archived. No new replies allowed.