title: A pointer to an address of an array
body: <p>Why does this code output: <code>1</code> ≡ <code>arr[0]</code> and not <code>&amp;arr[0]</code>?</p>
  <p>My assumption is that after the assignment, <code>ptr</code> holds the address of <code>&amp;arr</code>, which is a pointer to the first element of <code>arr</code> or <code>arr[0]</code>.</p>
  <p>So dereferencing the <code>ptr</code> should yield the value stored at that address, which is the memory location of the first element.</p>
  <pre class="lang-cpp prettyprint-override"><code>#include&lt;stdio.h&gt;
  
  int main(void) {
      int arr[] = { 1 };
      int* ptr = &amp;arr;
      printf(&quot;%d\n&quot;, *ptr);
      return 0;
  }
  </code></pre>