how to convert hex to ascii

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dr645965
    New Member
    • Jun 2010
    • 1

    how to convert hex to ascii

    HI
    My hard drive id is 18 5D BC , how can i convert it into ascii or text using C / c++

    some one translated but i do not know how
    18 = M
    5D = K
    BC = E

    thanks
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    I do not know how either, if the decoded values you give are correct you would need to find out from somewhere what the coding used to encode the characters were because they do not conform to any character set I am familiar with.

    Comment

    • alexis4
      New Member
      • Dec 2009
      • 113

      #3
      This is not ASCII...

      Comment

      • whodgson
        Contributor
        • Jan 2007
        • 542

        #4
        Hex is a numerical format.ASCII is not a numerical format but a numerical code for characters like commas and alphabetical letters. You can`t convert between a code and a format but you can convert a code from its integer format to a hex format.

        Comment

        • johny10151981
          Top Contributor
          • Jan 2010
          • 1059

          #5
          Try this.
          step 1:
          read hexa value
          step 2:
          assign hexa value to an integer variable(trying develop function to transfer from hexa to Decimal. not that hard)
          decimal=toDecim al(hexa); //hexa is array of char
          step 3:
          printf("%c",dec imal);

          step 4:
          repeat step 1:3 until finish all hexas

          Best regards,
          johny

          Comment

          Working...