Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hexadecimal (ascii) to int

Status
Not open for further replies.

sangen

Programmer
Jun 6, 2008
2
ES
Hello,

I have this string "3A3B" (this is hexadecimal,2 bytes) and I want to convert to integer.

Do you know any function that do it?

Thank you very much.
 
Use sscanf() with the %x conversion format.


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 

Thank you for your reply
I've never used this function before, very useful.
I am programming a PIC micro and this function is not included
in <stdio.h>, it's a shame, I'll have to do this function myself.
 
Try looking in stdlib.h or string.h.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top