title: Memory filling when writing int vs uint16_t
body: <p>I have been looking through some code and I saw an interesting thing : at some point there is a line </p>
  
  <pre><code>pTable[i] = ((int *)val)[i]; // case 1
  </code></pre>
  
  <p><code>pTable</code> is a <code>uint16_t</code> pointer and val is a <code>void</code> pointer; so I thought to change it to</p>
  
  <pre><code>pTable[i] = ((uint16_t *)val)[i]; // case 2
  </code></pre>
  
  <p>and spotted some differences in the output. So I start to debut it and see that the memory is getting arranged differently. Supposing that the data in the void pointer is something like <code>val[0] = 0x1234</code> and <code>val[1] = 0x5678</code></p>
  
  <ul>
  <li>in the first case (case 1), the memory dump shows <code>addr 56781234</code></li>
  <li>while in the second one (case 2) the memory dump shows <code>addr 00001234 00005678</code></li>
  </ul>
  
  <p>The code is a huge, not mine and I cannot put here, but it's a parser (it reads values form a file). What arrives in that void pointer may be <code>int</code> or <code>float</code> values (in my case, they were <code>int</code>).</p>
  
  <p>I suppose it's something about interpreting the pointer data, but I cannot explain it myself, can someone explain it to me ? Thanks</p>