title: c++ parse two bytes to int
body: <p>I have two bytes read from a sensor over I2C, these are stored as <code>unsigned char</code>. I do know which is the most significant byte, and which is the least significant byte.</p>
  
  <pre><code>unsigned char yawMSB;
  unsigned char yawLSB;
  </code></pre>
  
  <p>How would I go about converting these two bytes of data, into a single <code>int</code>?</p>
  
  <p>I've had this implemented properly in C# using</p>
  
  <pre><code>BitConverter.ToInt16(new byte[] { yawLSB, yawMSB }, 0)
  </code></pre>