Hi i have done a simple LZW compressor in C but i couldn't find anything about how to write compressed values to a file.
For example i compressed a txt file which is "banana bandana" and the output code is :
98 97 110 257 97 32 256 110 100 259
How should i write this into a new file? I need to read it again with C and decompress it.
I guess so, you should write your compressed data to another file, say 'banana.lzx'.
Here is how to write the compressed data to the file:
Here is how to read the compressed data from the file:
Remark: I don't know anything about LZW compression, but shouldn't the compressed data be a set of bytes? If so, why are you getting values above
255(cf.257,256and259) ?