J
Joseph
Hi all,
I was wondering if there is any lib or function could do the following
things:
input: a char
output: 8 digits binary presentation for that given char
Example:
-------------------------
input: k
Hex=6B <-ASCII table 'k'
Binary = 0110 1011
output: 0110 1011
done
-------------------------
input: K
Hex=4B <-ASCII table 'k'
Binary = 0100 1011
output: 0100 1011
done
--------------------------
(I am only dealing with the ASCII printable chars,no UNICODE,no non-
printables)
Am I clear with the question?
I want to make it standard and system independent(no windows/linux system
calls).
The only solution I came up with is to have a pre-computed table.Is there
any easier way of doing this ?
Thanks a lot in advance
Joseph
I was wondering if there is any lib or function could do the following
things:
input: a char
output: 8 digits binary presentation for that given char
Example:
-------------------------
input: k
Hex=6B <-ASCII table 'k'
Binary = 0110 1011
output: 0110 1011
done
-------------------------
input: K
Hex=4B <-ASCII table 'k'
Binary = 0100 1011
output: 0100 1011
done
--------------------------
(I am only dealing with the ASCII printable chars,no UNICODE,no non-
printables)
Am I clear with the question?
I want to make it standard and system independent(no windows/linux system
calls).
The only solution I came up with is to have a pre-computed table.Is there
any easier way of doing this ?
Thanks a lot in advance
Joseph