Apologies for such a lame question .
Language: ANSI C
So I was wondering if any of you have any ideas as to a good way to go about converting a string of ASCII representations of a HEX byte string e.g.:
char buf[] = "9EF4BCDE";
to an array of Hexidecimal bytes, equivalent to say:
char buf[] = "\x9e\xf4\xbc\xde";
Ideas would be appreciated.



LinkBack URL
About LinkBacks



I went out of my way to avoid using a second buffer. Though a two-step process could solve the problem of holes in the array by performing the conversion and then compacting the even elements.