< Previous | Contents | Next >

Using Iterators

Iterators are the key to using containers to their fullest potential. With iterators you can, well, iterate through a sequence container. In addition, important parts of the STL require iterators. Many container member functions and STL algorithms take iterators as arguments. So if you want to reap the benefits of these member functions and algorithms, youve got to use iterators.

 

Introducing the Hero’s Inventory 3.0 ProgramDeclaring IteratorsLooping through a VectorChanging the Value of a Vector ElementAccessing Member Functions of a Vector ElementUsing the insert() Vector Member FunctionUsing the erase() Vector Member Function