Solved

What's up with Iterators?

Posted on 1998-01-17
2
171 Views
Last Modified: 2013-12-14
I was thrilled to see the support for containers (i.e. vector, list, etc) in C++, but the concept of iterators eludes me.  I see they are all over these containers and since I don't really know how to use them, I'm having trouble implementing the containers.
I was thrying to implement a vector full of structs (or classes perhaps).  How would I go about doing this, and then how to iterators play a part in operating on this vector?  How does one obtain an iterator?  Any insight would be much appreciated!
0
Comment
Question by:Timbo011598
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 20 total points
ID: 1178431
The whole subject of iterators is probably beyond explaining in detail here, but I can give you some good reference materials to lookup:

Dr. Dobbs Journal, June 1996, Dan Zigmond on STL Iterators
Windows Developer Journal, March 1997, Using STL with MFC
Title       STL Tutorial and Reference
            Guide; C++ Programming
            With the Standard Template
            Library
Authors:    David R. Musser and Atul
            Saini
Publisher:  Addison-Wesley Publishing
            Company, Inc., 1996.
Pages:      400, hardcover
Price:      $35.95
ISBN:       0-201-63398-1

0
 
LVL 5

Expert Comment

by:yonat
ID: 1178432
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question