Hex To Ascii Converter Program

Free RS232 Terminal / Monitor / Debugger Program by SUDT and User Manual.

i have an hex string and want it to be converted to ascii string in C. How can i accomplish this??

nikhilnikhil

3 Answers

you need to take 2 (hex) chars at the same time.. then calculate the int value and after that make the char conversion like..

char d = (char)intValue; Supernatural stagione 3 completa ita download.

do this for every 2chars in the hex string

Hex To Ascii Converter Program

this works if the string chars are only 0-9A-F:

sharpnersharpner

strtol() is your friend here. The third parameter is the numerical base that you are converting.

Example:

BaldrickkBaldrickk

Few characters like alphabets i-o couldn't be converted into respective ASCII chars .like in string '6631653064316f30723161' corresponds to fedora . but it gives fedra

Just modify hex_to_int() function a little and it will work for all characters.modified function is

Now try it will work for all characters.

summarysummary
Hex

protected by revoApr 13 '18 at 20:19

Hex To Ascii Conversion Program In Embedded C

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Hex To Ascii Converter Application

Not the answer you're looking for? Browse other questions tagged c or ask your own question.