title: Array of pointers print values
body: <p>I have a ask question regarding this line: <code>cout &lt;&lt; *ptr[i] &lt;&lt; endl;</code>. 
  If I change like <code>&amp;ptr[i]</code> that and result is its addresses <code>0x7ffef7402a40</code>. </p>
  
  <p>My question is: What will I have to do to get values from this <code>cout &lt;&lt; &amp;ptr[i] &lt;&lt; endl;</code>, and not addresses?</p>
  
  <pre><code>  const int MAX = 3;
  
    int main () {
    int  var[MAX] = {10, 100, 500};
    int *ptr[MAX];
  
    for (int i = 0; i &lt; MAX; i++) {
    ptr[i] = &amp;var[i]; // assign the address of integer.
    }
  
     for (int i = 0; i &lt; MAX; i++) {
     cout &lt;&lt; "Value of var[" &lt;&lt; i &lt;&lt; "] = ";
     cout &lt;&lt; *ptr[i] &lt;&lt; endl;
     }
  
     return 0;
    } 
  </code></pre>
  
  <p>Result is:</p>
  
  <pre><code>  Value of var[0] = 10
    Value of var[1] = 100
    Value of var[2] = 500
  </code></pre>