Josh Parker wrote:
What is a good way for me to convert a Decimal to Hexadecimal. I need
the number to be stored in a variable, it will not be printed to the
screen. Any help that can be provided will help. Thank you
All integer values are the same, regardless of the base. The only[1] time you
need to know the base is when you print (e.g., printf with %x) or convert (e.g.,
strtol with base 16). IOW, there is no difference between storing an integer as
a decimal (i.e., base 10) or hexadecimal value.
/david
[1] also when you read with scanf, but this is not recommended.
--
Andre, a simple peasant, had only one thing on his mind as he crept
along the East wall: 'Andre, creep... Andre, creep... Andre, creep.'
-- unknown