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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hex code problem

Status
Not open for further replies.

paul51

Programmer
May 19, 2000
38
US
Does anyone know how to convert hex code to a readable format.
 
If I'm reading your question right, you should be able to read the binary elements into a string and use sprintf() to convert each part of the binary hex into the output text string:
Code:
char sHex[80];
char sOutput[80];

// additional code to read or memcpy() the binary into sHex...

sprintf(sOutput, "%02X%02X%02X%02X",
  sHex[0],
  sHex[1],
  sHex[2],
  sHex[3]);

Hope that helps! ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top