public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* STL - How to use of iterators?
@ 2000-02-14  8:57 Ivan Martinez
  2000-04-01  0:00 ` Ivan Martinez
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Martinez @ 2000-02-14  8:57 UTC (permalink / raw)
  To: gcc-help

Hello!
    I have readed some docs and tried some things with my compiler but I
don't get to understand the use of iterators very well. Suppose I have a
class A.

class A
{
    public:
        ...
        int number;
}

    Then I create a list with some instances.

main (int argc, char *argv []) {
    list<A> l;
    A a;
    l.push_back (a);
    l.push_back (a);
    l.push_back (a);
    ...

    Could somebody give me examples of accesing (reading and writing)
the member "number" of the elements of "l" sequently and randomly?.
Thanks in advance.

--
Ivan Martinez (Rodriguez)
Bch in Computer Science - MSc student
http://www.student.dtu.dk/~u990873
"Ponia Windows98 o superior, asi que instale Linux"



^ permalink raw reply	[flat|nested] 2+ messages in thread

* STL - How to use of iterators?
  2000-02-14  8:57 STL - How to use of iterators? Ivan Martinez
@ 2000-04-01  0:00 ` Ivan Martinez
  0 siblings, 0 replies; 2+ messages in thread
From: Ivan Martinez @ 2000-04-01  0:00 UTC (permalink / raw)
  To: gcc-help

Hello!
    I have readed some docs and tried some things with my compiler but I
don't get to understand the use of iterators very well. Suppose I have a
class A.

class A
{
    public:
        ...
        int number;
}

    Then I create a list with some instances.

main (int argc, char *argv []) {
    list<A> l;
    A a;
    l.push_back (a);
    l.push_back (a);
    l.push_back (a);
    ...

    Could somebody give me examples of accesing (reading and writing)
the member "number" of the elements of "l" sequently and randomly?.
Thanks in advance.

--
Ivan Martinez (Rodriguez)
Bch in Computer Science - MSc student
http://www.student.dtu.dk/~u990873
"Ponia Windows98 o superior, asi que instale Linux"



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-14  8:57 STL - How to use of iterators? Ivan Martinez
2000-04-01  0:00 ` Ivan Martinez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).