title: Bit shifting a byte by more than 8 bit
body: <p>In <a href="http://rclermont.blogspot.tw/2010/02/convert-long-into-byte-array-in-cc.html" rel="nofollow">here</a>
  When converting from bytes buffer back to unsigned long int:</p>
  
  <pre><code>  unsigned long int anotherLongInt;
  
    anotherLongInt = ( (byteArray[0] &lt;&lt; 24) 
                     + (byteArray[1] &lt;&lt; 16) 
                     + (byteArray[2] &lt;&lt; 8) 
                     + (byteArray[3] ) );
  </code></pre>
  
  <p>where byteArray is declared as <code>unsigned char byteArray[4];</code></p>
  
  <p>Question:</p>
  
  <p>I thought <code>byteArray[1]</code> would be just one unsigned char (8 bit). When left-shifting by 16, wouldn't that shift all the meaningful bits out and fill the entire byte with 0? Apparently it is not 8 bit. Perhaps it's shifting the entire byteArray which is a consecutive 4 byte?  But I don't see how that works.</p>