Should I use a bit mask when truncating uint64_t to uint8_t[i]?
<p>If I have a large int, say a uint64_t, and an array of uint8_t, e.g.:  </p>

<pre class="lang-cpp prettyprint-override"><code>uint64_t large = 12345678901234567890;
uint8_t small[5];
</code></pre>

<p>and I want to copy the 8 least significant bits of the <code>uint64_t</code> into an element of the array of <code>uint8_t</code>, is it safe to just use:  </p>

<pre class="lang-cpp prettyprint-override"><code>small[3] = large;
</code></pre>

<p>or should I use a bit-mask:  </p>

<pre class="lang-cpp prettyprint-override"><code>small[3] = large &amp; 255;
</code></pre>

<p>i.e. Is there any situation where the rest of the large int may somehow overflow into the other elements of the array?</p>