In article <20120131162102.GB30381 at brevard.conman.org>,
Sean Conner <spc at conman.org> writes:
A friend recently raised an issue with some code I
wrote (a hex dump
routine) saying it depended upon ASCII and thus, would break on non-ASCII
based systems (and proposed a solution, but that's beside the issue here).
I assume he's saying this because you did something like '0' + x or
'A' + x to compute the hex digits. The obvious fix is to instead
index a string by the digit value:
"0123456789abcdef"[x]
--
"The Direct3D Graphics Pipeline" -- DirectX 9 version available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>
Legalize Adulthood! <http://legalizeadulthood.wordpress.com>