title: C++ convert hex string to signed integer
body: <p>I want to convert a hex string to a 32 bit signed integer in C++.  </p>
  
  <p>So, for example, I have the hex string "fffefffe".  The binary representation of this is 11111111111111101111111111111110.  The signed integer representation of this is: -65538.  </p>
  
  <p>How do I do this conversion in C++?  This also needs to work for non-negative numbers.  For example, the hex string "0000000A", which is 00000000000000000000000000001010 in binary, and 10 in decimal.</p>