Possible Duplicate:
C++ convert hex string to signed integer
I'm trying to convert a hex string to an unsigned int in C++. My code looks like this:
string hex("FFFF0000");
UINT decimalValue;
sscanf(hex.c_str(), "%x", &decimalValue);
printf("\nstring=%s, decimalValue=%d",hex.c_str(),decimalValue);
The result is -65536 though. I don't typically do too much C++ programming, so any help would be appreciated.
thanks, Jeff