So I'm trying to write a program that will read a program that will be reading characters/strings in regular text and will output the information in hexadecimal format. An example of such is this "UNAME" = "55 4E 41 4D 45 28 31 29" in hexadecimal format. I just don't know where to start, any ideas?
infatuate
0
Newbie Poster
Recommended Answers
Jump to PostCharacters are 8 bit integers. Use the appropriate printf format strings. To output the hex value of a character you would use %.02x
Jump to PostTo me "UNAME" converts to hex as "55 4E 41 4D 45". How you do arrive at "55 4E 41 4D 45 28 31 29", probably remains a mystery to all of us.
All 5 Replies
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
infatuate
0
Newbie Poster
rishif2
57
Posting Whiz in Training
ddanbe
2,724
Professional Procrastinator
Featured Poster
naveen1993
-3
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.