Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

What's up with Iterators?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

792 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