Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • This, you could do the cast and length selection in the printf formatting. Commented Jan 14, 2010 at 20:23
  • well the problem with printf was that when i used it and it returns the number values in the count i came across issues like.. a2 it comes out to 162. this means that if i have another byte like 1b that would be 27. say if i wanted to print 6 and the next byte was 68 the decimal value of that hex would be 104. and i would end up only printing 16227 because 104 is more than 6 digits. see the issue? Commented Jan 14, 2010 at 20:31
  • OK, I'm confused. You have the string "1aa23486b2" in your question. What is the output you want for this particular string of hex values? Commented Jan 14, 2010 at 20:35