Solved

What's up with Iterators?

Posted on 1998-01-17
2
170 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Socket Programming (Unix) 8 118
How to convert MFC APP to Win32 APP. 19 69
computer science syllabus 3 70
c++ using a LPCOLESTR * and adding a string varaible to the Pointer 2 48
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…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

910 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now