So when we need to traverse a container from start to end we write something like
for (i = v->begin(); i != v->end(); i++)
assuming i
"end will always point to one past the last element in container" means that if you increment iterator that points to the last element it will be equal to the result of end()
. Implementation can be different. In Visual C++ std::vector::end()
returns implementation specific iterator that holds zero pointer.