title: Calculate array length via pointer arithmetic
body: <p>I was wondering how <code>*(&amp;array + 1)</code> actually works. I saw this as an easy way to calculate the array length and want to understand it properly before using it. I'm not very experienced with pointer arithmetic, but with my understanding  <code>&amp;array</code> gives the address of the first element of the array. <code>(&amp;array + 1)</code> would go to end of the array in terms of address. But shouldn't <code>*(&amp;array + 1)</code> give the value, which is at this address. Instead it prints out the address. I would really appreciate your help to get the pointer stuff clear in my head.</p>
  
  <p>Here is the simple example I'm working on:</p>
  
  <pre><code>int numbers[] = {5,8,9,3,4,6,1};
  int length = *(&amp;numbers + 1) - numbers;
  </code></pre>