title: 2 Chars to Short in C
body: <p>I've got 2 chars. </p>
  
  <p>Char <code>128</code> and Char <code>2</code>.</p>
  
  <p>How do I turn these chars into the Short <code>640</code> in C?</p>
  
  <p>I've tried </p>
  
  <pre><code>unsigned short getShort(unsigned char* array, int offset)
  {
      short returnVal;
      char* a = slice(array, offset, offset+2);
      memcpy(&amp;returnVal, a, 2);
      free(a);
      return returnVal;
  }
  </code></pre>
  
  <p>But that didn't work, it just displays it as <code>128</code>. What's the preferred method?</p>