Obtain an iterator to the start of vector. - C++ STL

C++ examples for STL:vector

Description

Obtain an iterator to the start of vector.

Demo Code

#include <iostream>
#include <vector>
using namespace std;
void show(const char *msg, vector<char> vect);
int main() {/*from   ww  w  .  j  a v  a2  s  . c  o  m*/
   // Declare an empty vector that can hold char objects.
   vector<char> v;
   // Declare an iterator to a vector<char>.
   vector<char>::iterator itr;
   // Obtain an iterator to the start of v.
   itr = v.begin();
   return 0;
}

Related Tutorials