I have a string which contains a hexadecimal value:
"29E94B25"
I want to convert this hexadecimal string into an unsigned long using a base of 10. e.g. I want to create an unsigned long with a value of:
703154981
How can I do this type conversion?
You can read this string into an unsigned long with
strtoul:You can then print it in base-10 with
printf.There’s no such thing as an
unsigned longwith a base other than 2.