Linked List Help please

From: Shane (deja_NOSPAM__at_zaft.com)
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...
anyway...)

Actually, I have been able to get some help from
http://www.sgi.com/tech/stl/List.html

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.

#import<list>

list<People::People> PP;

//person is a People
person.setName("Shane");

PP.push_back(person);

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

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
http://www.sgi.com/tech/stl/List.html in black and white. I just
don't understand it.

Shane



Relevant Pages

  • Re: CSS side menu and IE -- both styles posted online now
    ... Peter Mount wrote: ... This site is good as it has tutorials from professional web developers. ... I had a look at it in IE6 and I see now that it does look bad as you say. ... found a great template website, openwebsign.org, and found an open source template I really liked that even came in 2 versions. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: blank fields - creating template in Word for Mac
    ... especially the forms tutorials by Dian Chapman that this article links to. ... Suzanne S. Barnhill ... Microsoft MVP (Word) ... template text document with blank fields that can be filled in by the ...
    (microsoft.public.word.newusers)
  • Generating templates - CS file not appearing
    ... I've followed the tutorials on template ... generation but for some reason, ... Google provided no help as far ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Vb.net "About page" template
    ... copyright and found under help menus) from a template. ... I've looked for new file/project types in visual studio 2008 and searched ... the Internet for tutorials and temples for about pages without success. ... Windows Form ...
    (microsoft.public.dotnet.languages.vb)
  • Tutorials for Conditional Macro
    ... Anybody have any good tutorials for using the "Condition" portion of the ... I'm having some trouble figuring out what types of things I ...
    (microsoft.public.access.macros)