hex to ascii help!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trixxy
    New Member
    • Sep 2008
    • 26

    hex to ascii help!

    Hi,

    i'm new to c++ and i'm learning it on my own during my free time. how do i convert a long string of hex into ascii (by reading in 2s).
  • Meetee
    Recognized Expert Contributor
    • Dec 2006
    • 928

    #2
    Hi,

    Please google before you ask query here as sometimes it is more useful than anything.

    Following link I have found from google which may help you.


    Regards

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      What makes you think this conversion is necessary?
      It helps to start by describing your problem from a high-level perspective (that is, far from concerns about how to code it).

      Comment

      • whodgson
        Contributor
        • Jan 2007
        • 542

        #4
        Do you mean how do you convert from hex to bin?
        eg Oxff = 1111 1111 ?........I think

        Comment

        • sujaiganesh
          New Member
          • Sep 2008
          • 5

          #5
          put the hexadecimal number like "\x42" then you get corresponding ascii value for that number

          Comment

          • boxfish
            Recognized Expert Contributor
            • Mar 2008
            • 469

            #6
            Is this just one hexidecimal number that is less than 256? If it is, just cast it to a char.
            Edit:
            Oh, sorry, didn't read your original post. Looks like the link zodilla found may have something. You just need a way to convert a string of two hex digits to a number. You could use a strstream object's extraction operator.
            Last edited by boxfish; Sep 30 '08, 03:22 PM. Reason: Didn't see "long string of hex digits"

            Comment

            Working...