for (vector<Student_info>::const_iterator iter = students.begin();
iter != students.end(); ++iter)
cout << (*iter).name << endl;
In Accelerated C++, code above was told to output all of the data contain in the vector, but if the loop stop when iter != students.end() equal to students.end(), then how does it will proceed to the last element of the vector?
If I understood well what you asked,it is so because the last element of a vector is actually on the position v.end()-1. So to an element before the v.end() should the loop stop to access all the elements. Is that you asked?