#include #include using namespace std; int main() { int a[] = {10, 20, 30}; size_t n = sizeof a / sizeof a[0]; vector v(a, a + n); const vector::iterator it1 = v.begin(); //++it1; //won't compile: it1 must always refer to v[0] vector::const_iterator it2 = v.begin(); //++*it2; //won't compile: can't use it2 to change v[0] from 10 to 11 const vector::const_iterator it3 = v.begin(); //both of the above //++it3; //won't compile: it3 must always refer to v[0] //++*it3; //won't compile: can't use it3 to change v[0] from 10 to 11 v[0] = 11; //v.operator[](0) = 11 return EXIT_SUCCESS; }