title: Multi-dimensional array as a pointer - where are addresses of subarrays stored?
body: <p>In the tutorial video about pointers (<a href="https://www.youtube.com/watch?v=zuegQmMdy8M" rel="nofollow noreferrer">https://www.youtube.com/watch?v=zuegQmMdy8M</a>) there are the following code and illustration:</p>
  <pre class="lang-c prettyprint-override"><code>int B[2][3]; // we define an array
  </code></pre>
  <p><a href="https://i.stack.imgur.com/hyoms.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hyoms.png" alt="enter image description here" /></a></p>
  <p>The following facts about that code were given:</p>
  <ul>
  <li>Printing B (or &amp;B[0]) would return 400 (the address of the first sub-array)</li>
  <li>Printing *B (or B[0] or &amp;B[0][0]) would return 400 (the address of the first element in the first sub-array)</li>
  </ul>
  <p>I struggle a bit with an understanding of that. How can <code>B</code> and <code>*B</code> have the same value? We can clearly see in the illustration that under address 400 there is a value 2. If <code>B</code> = 400, then <code>*B</code> = 2!</p>
  <p>My understanding is that the value of <code>B</code> would be the address of the first element of the outer array in the memory. Then, the <code>*B</code> would return the address of the first sub-array in the memory.</p>
  <p>According to the illustration, <code>B</code> (not shown) has a value 400. Then, under 400, there is the first value of the first sub-array. Where are the addresses of the sub-arrays stored?</p>