title: How can I cast a char to an unsigned int?
body: <p>I have a char array that is really used as a byte array and not for storing text. In the array, there are two specific bytes that represent a numeric value that I need to store into an unsigned int value.  The code below explains the setup.</p>
  
  <pre><code>char* bytes = bytes[2];
  bytes[0] = 0x0C; // For the sake of this example, I'm 
  bytes[1] = 0x88; // assigning random values to the char array.
  
  unsigned int val = ???; // This needs to be the actual numeric 
                          // value of the two bytes in the char array.  
                          // In other words, the value should equal 0x0C88;
  </code></pre>
  
  <p>I can not figure out how to do this.  I would assume it would involve some casting and recasting of the pointers, but I can not get this to work.  How can I accomplish my end goal?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Thank you Martin B for the quick response, however this doesn't work.  Specifically, in my case the two bytes are <code>0x00</code> and <code>0xbc</code>.  Obviously what I want is <code>0x000000bc</code>.  But what I'm getting in my unsigned int is <code>0xffffffbc</code>.</p>
  
  <p>The code that was posted by Martin was my actual, original code and works fine so long as all of the bytes are less than 128 (.i.e. positive signed char values.)</p>