Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hex address to decimal

0 views
Skip to first unread message

fan

unread,
Sep 21, 2000, 3:00:00 AM9/21/00
to
hello:
could someone tell me what liberary and/ function should i use
to convert a hex address to a decimal number thanks

fan


Sent via Deja.com http://www.deja.com/
Before you buy.

[ Send an empty e-mail to c++-...@netlab.cs.rpi.edu for info ]
[ about comp.lang.c++.moderated. First time posters: do this! ]


Jack Klein

unread,
Sep 22, 2000, 3:00:00 AM9/22/00
to
On 21 Sep 2000 11:16:02 -0400, fan <fa...@my-deja.com> wrote in
comp.lang.c++.moderated:

> hello:
> could someone tell me what liberary and/ function should i use
> to convert a hex address to a decimal number thanks
>
> fan

I'm afraid you haven't really provided enough information. What do
you mean by "hex address"? It this a string of text characters
representing hex digits? If so, is it in a C style string (array of
chars terminated by '\0'), or a std::string, or what exactly?

Jack Klein
--
Home: http://jackklein.home.att.net
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ http://www.faqs.org/faqs/C-faq/learn/

Alexander Bartolich

unread,
Sep 22, 2000, 3:00:00 AM9/22/00
to
fan wrote:
> could someone tell me what liberary and/ function should
> i use to convert a hex address to a decimal number thanks

Function strtol. Last argument is radix.
A value of 16 reads plain hex.
If set to 0 the function accepts C-style numbers,
e.g. "0x123" = 291, "0123" = 83, "123" = 123

--
Electron is a fierce god, tolerating neither Dionysos nor Aphrodite.

0 new messages