Ascii to hex and hex to Ascii

This is a discussion on Ascii to hex and hex to Ascii within the C Programming forums, part of the General Programming Boards category; Hi everyone, Do you all have any idea on ascii to hex and hex back to ascii? I'm having a ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    58

    Ascii to hex and hex to Ascii

    Hi everyone,
    Do you all have any idea on ascii to hex and hex back to ascii?
    I'm having a function that only take in char array input of eg."1A2B", I have to convert whatever I entered into as a string eg."ABCDE" to a hex format "xx". Not only that, I will have to convert it back to hex again.

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    sscanf(inbuffer, "%x",&outInt); ?
    sprintf(outbuffer,"%X",inInt);?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Char to ASCII Hex Value Troubles
    By MattMik in forum C++ Programming
    Replies: 6
    Last Post: 03-25-2008, 03:17 PM
  2. Replies: 11
    Last Post: 03-24-2006, 11:26 AM
  3. Encrypting text file with ASCII hex
    By supaben34 in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2005, 06:35 PM
  4. Hex to Ascii conversion
    By Ryno in forum C Programming
    Replies: 2
    Last Post: 03-24-2005, 09:16 AM
  5. ASCII v's hex
    By sononix in forum C++ Programming
    Replies: 2
    Last Post: 01-20-2005, 05:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21