How do I pack 8 4-bit binary numbers into a long int?
The program is to take an input string of 8 ascii charcaters, (digits 0 to 9 only), convert them to their 4 bit binary equivilants and pack them into a long int.
eg:
input string: 13560927
= 0001 0011 0101 0110 0000 1001 0010 0111.
thanks...



LinkBack URL
About LinkBacks



)
You could likely use an array of structures of integer x:4; but I haven't tried it, and I know this way will work. If you could use an array of nyb, then you could forgo the case statement with a single line: