title: Shift and shift assignment giving different results
body: <p>My goal here is to remove <code>byte-count+1</code> bits from the left of this 8-bit integer (or as you'd often call it, <code>unsigned char</code>.</p>
  <p>Should be simple really, but this bit of code</p>
  <pre><code>uint8_t val = 0xC3;
  uint8_t byte_count = 2;
  uint8_t cc = val &lt;&lt; (byte_count+1) &gt;&gt; (byte_count+1);
  printf(&quot;%X&quot;, cc);
  </code></pre>
  <p>Gives me <code>C3</code> as a result.</p>
  <p>While this one</p>
  <pre><code>uint8_t val = 0xC3;
  uint8_t byte_count = 2;
  uint8_t cc = val;
  cc &lt;&lt;= (byte_count+1);
  cc &gt;&gt;= (byte_count+1);
  printf(&quot;%X&quot;, cc);
  </code></pre>
  <p>Gives me just the <code>3</code>.</p>
  <p>Yes, I've tried putting a bunch of parenthesis around it.<br />
  Yes, I've tried casting everything in the expression to <code>uint8_t</code>.</p>
  <p>Why does this happen?</p>