Relative Content

Tag Archive for cbit-manipulationhuffman-codebinary-operators

Bit bufferer doesn’t behave as expected in C

I have to write individual Bits to a file (for huffman code). To do so I send bits to a function which buffers them until a byte is filled and then returns the byte. I can´t figure out why it doesn’t work, the function outputs wrong bytes (but no errors).
Here is the bitsBuffer function: