Overview
Iterators are a generalization of pointers, which means that we can have access to a sequence elements without knowing the element type or the position.
An iterator is an object that can iterate or navigate or traverse over elements in the containers that represent data structures.
There are
five iterator categories according to operations defined on them.
Input iterator reads forward and is provided by istream
Output iterator steps forward with write access and is provided by ostream and inserter
Forward iterator may store and retrieve values
Bidirectional iterator performs forward and backward moving
Random access iterator allows you to access elements in any order