Manipulation of bits
Posted on 1998-10-04
I'm writing a program to play with some networking stuff, but I'm having one nagging problem, some of my information comes back where the data I want is 4 bits in length. The other 4 bits that would come with the data I don't really care about so can be mangled if neccasary. I'm wondering how I get at these 4 bits I want( they're the latter 4 bits BTW) and then how to convert them into something meaningful such as one of the basic data types(char, int etc.) An algorithm is more what I'm looking for than having someone write the code for me. Thanks.
Also, I'm recieving the bits in the form of a char.