previous
|
start
|
next
Linked Lists
To move an iterator forward in the list, use the
++
operator.
pos++;
To move an iterator backward in the list, use the
--
operator.
pos--;
You can find the value that is stored in the position with the
*
operator.
string value = *pos;
The value
*pos
represent the value that is stored in the list.
*pos = "Van Dyck, Vicki";
To insert another string before the iterator position, use the
insert
function.
staff.insert(pos, "Reindeer, Rudolph");
previous
|
start
|
next