title: C++ hex string to unsigned int
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1070497/c-convert-hex-string-to-signed-integer">C++ convert hex string to signed integer</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to convert a hex string to an unsigned int in C++. My code looks like this:</p>
  
  <pre><code>string hex("FFFF0000");
  UINT decimalValue;
  sscanf(hex.c_str(), "%x", &amp;decimalValue); 
  printf("\nstring=%s, decimalValue=%d",hex.c_str(),decimalValue);
  </code></pre>
  
  <p>The result is -65536 though. I don't typically do too much C++ programming, so any help would be appreciated.</p>
  
  <p>thanks,
  Jeff</p>