Convert Hex num in a File to ASCII
I have a file which I have to open using fopen. Now the issue with the
file is its a hex file so when I open it I see the Hex numbers for example
RG is 5247. Now when I read the file using (fgets(line, sizeof(line), fd)
line[0] is 5
line[1] is 2
line[2] is 4
line[4] is 7.
52 is the hex for char R and 47 is the hex for char G. I want to obtain
that. I know I can use a lookuptable and this will work, but I was looking
for a more different solutions. Have tried a lot but to no avail.
Please help!!
No comments:
Post a Comment