title: why should we use pointer for this code?
body: <p>I found following code from tutorial of C++.
  In:</p>
  
  <pre><code>cout &lt;&lt; "value of v = " &lt;&lt; *v &lt;&lt; endl;
  </code></pre>
  
  <p>you can see that <code>*v</code> is used. Can you tell me why should not we use <code>v</code> instead of <code>*v</code>?</p>
  
  <pre><code>#include "StdAfx.h"
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  
  int main()
  {
     // create a vector to store int
     vector&lt;int&gt; vec; 
     int i;
  
  
     // access 5 values from the vector
     for(i = 0; i &lt; 5; i++){
        cout &lt;&lt; "value of vec [" &lt;&lt; i &lt;&lt; "] = " &lt;&lt; vec[i] &lt;&lt; endl;
     }
  
     // use iterator to access the values
     vector&lt;int&gt;::iterator v = vec.begin();
     while( v != vec.end()) {
        cout &lt;&lt; "value of v = " &lt;&lt; *v &lt;&lt; endl;
        v++;
     }
     cin.get();
     cin.get();
     return 0;
  }
  </code></pre>