I have following hex value
CString str;
str = T("FFF000");
How to convert this in to an unsigned long
?
You can use strtol
function which works on regular C strings. It converts a string to a long using a specified base:
long l = strtol(str, NULL, 16);
details and good example: http://www.cplusplus.com/reference/clibrary/cstdlib/strtol/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With