title: (C) Bit shifting/char placement in a short int variable
body: <p>New to C.</p>
  
  <p>The overall goal here is to put a character in a short int, and have it occupy the left byte of the short int rather than the right byte. To elaborate -</p>
  
  <p>I'm trying to take a variable:</p>
  
  <pre><code>unsigned short int packager;
  </code></pre>
  
  <p>(short int is 2 bytes.)</p>
  
  <p><br>
  and put this char in it:</p>
  
  <pre><code>unsigned char temp = A;
  </code></pre>
  
  <p>(A in binary is 01000001.)</p>
  
  <p><br>
  So, how is this done? What I want the short int to look like is this:</p>
  
  <p>0100 0001 0000 0000</p>
  
  <p><br>
  My current idea is to work in hex values. If I could say something like 
  <code>packager = 0x(temp)</code> or 0x(temp) and append a 0? (idk..) and then use shifting or masking.. I might be able to get somewhere. The biggest roadblock seems to be my inability to use a variable to make a hex value. Again, the overall goal is to put a character in a short int, and have it occupy the left byte of the short int rather than the right byte.</p>