Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/20/04 14:39
Read: times


 
#65196 - You already have it!!!!
Responding to: ???'s previous message
said:
OK I've a string which contains "$0#1"
I require a string which contains the HEX verson of this, i.e. ""24302331"

What is your problem?

If you have the string "$0#1", then that is already stored in memory as 0x24302331 - in fact, as 0x24 0x30 0x23 0x31.
You already have it - you don't need to convert anything!

If you mean you want to take the byte value 0x24 (or 00100100 in binary, or 36 in decimal, or '$' as an ASCII-coded character) and display it as "24" (the character '2' followed by the character '4'), then see my earlier post, Apply a little thought, and apply the same technique in reverse!

Or just use (s)printf, if you're in 'C'

Or, as has already been said, see the myriad other times this same question has been asked!

List of 17 messages in thread
TopicAuthorDate
ASCII TO HEX QUESTION            01/01/70 00:00      
   RE: ASCII TO HEX QUESTION            01/01/70 00:00      
   RE: ASCII TO HEX QUESTION            01/01/70 00:00      
      RE: ASCII TO HEX QUESTION            01/01/70 00:00      
         RE: ASCII TO HEX QUESTION            01/01/70 00:00      
         RE: ASCII TO HEX QUESTION            01/01/70 00:00      
         RE: ASCII TO HEX QUESTION            01/01/70 00:00      
         You already have it!!!!            01/01/70 00:00      
            RE: You already have it!!!!            01/01/70 00:00      
               RE: why guess            01/01/70 00:00      
                  RE: why guess            01/01/70 00:00      
                     RE: why guess            01/01/70 00:00      
                        RE: why guess            01/01/70 00:00      
                     Speculation            01/01/70 00:00      
         RE: ASCII TO HEX QUESTION            01/01/70 00:00      
   Apply a little thought            01/01/70 00:00      
      RE: Apply a little thought            01/01/70 00:00      

Back to Subject List