In C++ library arrays, what are some cases where it's useful to have the .begin()
and .end()
member functions?
On cplusplus.com, the example use is to iterate through an array:
for ( auto it = myarray.begin(); it != myarray.end(); ++it )
But
for (int i = 0; i < myarray.size(); i++)
can be used for that.