title: how the iterator in c++ could be printed?
body: <p>Suppose, I have declared a vector in <code>C++</code> like this:</p>
  
  <pre><code>vector&lt;int&gt;numbers = {4,5,3,2,5,42};
  </code></pre>
  
  <p>I can iterate it through the following code:</p>
  
  <pre><code>for (vector&lt;int&gt;::iterator it = numbers.begin(); it!=numbers.end(); it++){
      // code goes here
  }
  </code></pre>
  
  <p>Now, I would talk about coding in the block of <code>for loop</code>.</p>
  
  <p>I can access and change any value using this iterator. say, I want to increase every value by 10 and the print. So, the code would be:</p>
  
  <pre><code>*it+=10;
  cout &lt;&lt; *it &lt;&lt; endl;
  </code></pre>
  
  <p>I can print the address of both iterator and elements that are being iterated.</p>
  
  <p>Address of iterator can be printed by:</p>
  
  <pre><code>cout &lt;&lt; &amp;it &lt;&lt; endl;
  </code></pre>
  
  <p>Address of iterated elements can be printed by:</p>
  
  <pre><code>cout &lt;&lt; &amp;(*it) &lt;&lt; endl;
  </code></pre>
  
  <p>But <strong>why the iterator itself could not printed by doing the following?</strong></p>
  
  <pre><code>cout &lt;&lt; it &lt;&lt;endl;
  </code></pre>
  
  <p>At first I thought the convention came from <code>JAVA</code> considering the security purpose. But if it is, then why I could print it's address?</p>
  
  <p>However, <strong>Is there any other way to do this? If not, why?</strong></p>