Linked List Help please

From: Shane (
Date: 08/11/04

Date: 10 Aug 2004 23:16:15 -0700

Thanks in advance for the help.

I'm new to the STL and havig a bit of trouble figuring out the whole
iterator thing. I am using the <list> template and I can insert
elements into the list just fine. I just can't get them out. It's
like the roach motel! (uh, you can go in, but don't come out...

Actually, I have been able to get some help from

I can get the forst element or the last, but I can't find one
in-between or pick one out like you would in an array by referencing
the element number.

Can someone give me a hand or point me to a tutorial? I have found a
lot of tutorials, but all of them use ints as elements in the list,
and I need to store objects.


list<People::People> PP;

//person is a People


Now the person has been added to the linked list. I can get it out by

person2 = PP.front();
cout << person2.getName();

but this is only if the person is at the front of the linked list.

Any suggestions? I know it's all there at in black and white. I just
don't understand it.