7 years, 11 months ago.  This question has been closed. Reason: Off Topic

Did that ascii start out as a 32 bit int or uint? If so it might be easier to break it into bytes first then a single printf command will do what you want

posted by Oliver Broad 15 May 2016

1 Answer

7 years, 11 months ago.

So it is already ascii, but you want to add 0x in front of it? Define a buffer of sufficient length and then simply write a simple loop that adds "0x" at the correct places and copy the values of the input array to the correct location in the output buffer.

any example?

posted by J Daniel Martinez C 15 May 2016

Just try it by doing it step by step.

posted by Erik - 15 May 2016