access field for vector : vector access « vector « C++ Tutorial






#include <vector>
#include <string>
using namespace std;

int main(int argc, char** argv)
{
  vector<string> stringVector(10, "hello");

  for (vector<string>::iterator it = stringVector.begin();it != stringVector.end(); ++it) {
    it->append(" there");
  }
}








16.25.vector access
16.25.1.Random access of a vector
16.25.2.the use of the subscripting operator
16.25.3.Checked and Unchecked Access of a Vector
16.25.4.access field for vector
16.25.5.Bidirectional random access iterators