Hello,can anyone explain me about iterator? I know a little bit about it, but wouldn't be able to create something serious ! :]
Also skype chat :
Begginners of C++ skype chat! 6People atm ,creating it tommorow ,add me in skype (mantasxxl3) if you want to join us :P . [So we can help each other ,without spamming forums and waiting hours for an answer :) ]
An iterator is a concept which is designed to transverse, and possibly modify, the elements of a container, though, the concept of iterators is not reserved specifically for containers. There are three main types of iterators:
1) Bi-directional iterators: these iterators can move freely between the first and last element of a container.
2) Forward iterators: these iterators can only transverse a container from the first element to the last and no higher. C++ containers contain a "begin( )" member-function which returns an iterator to the very first element of the container.
3) Reverse iterators: these iterators can only transverse a container from the end element to the first element and no lower. C++ containers contain a "rbegin( )" member-function which returns the last element of the container.
There are also "constant iterators" which behave in the same way as non-constant iterators, but as the name implies, they cannot modify the elements of a container.
Standard C++ containers contain the following iterators:
Note the absence of forward iterators. This is because in C++, containers use the bi-directional iterator to represent the forward iterators as well as the reverse iterator.