Setting/Clearing Bits working with Nybbles in C++
<p>I am working on a college assignment where you need to store two nybbles in a byte. When initialising an array of nybbles each nybble has to be assigned the same value for example 5.  Could I convert 5 into unsigned int and then bit shift it 4 times and then &amp; the combination.</p>

<pre><code>unsigned int value = 5;
unsigned int value2 = 5;
unsigned int value3 = value | (value2&lt;&lt;4)
</code></pre>

<p>Would that be correct?</p>
