#include <iostream>
#include <vector>

using namespace std;

int main()
{
    vector<int> vect;
    for (int count=0; count < 6; ++count)
        vect.push_back(count);

    vector<int>::const_iterator it; // declare a read-only iterator
    it = vect.cbegin(); // assign it to the start of the vector
    while (it != vect.cend()) // while it hasn't reach the end
    {
        cout << *it << ' '; // print the value of the element it points to
        ++it; // and iterate to the next element
    }

    std::cout << '\n';
}