This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
STL - How to use of iterators?
- To: gcc-help at gcc dot gnu dot org
- Subject: STL - How to use of iterators?
- From: Ivan Martinez <ex08 at kalman dot iau dot dtu dot dk>
- Date: Mon, 14 Feb 2000 16:58:45 +0000
- Reply-To: ivan_m_r at email dot com
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"