I've read the LZW compression algorithm. And i know i must use 12 bit number to code the string.
But i dont know how to write this code 12 bit to file. Because when using fwrite function, it just accepts bytes (not bit).
How can i do that with bit. Someone tell me do this :
write 16bit (2 bytes) , certainly remaining 4 bit from the next code. And add the next 16 bit to file, surely contains 8 bit from the next code, and so one. I think it is right, isn it?
But how i can do that?
Please suggesting me all the technologies i have to learn for this purpose.
Or give me the link to page that contain this topic or tutorial.
Thanks