File Compression

How can we compress any text file using c. can anybody provide me sample code

Questions by kaivalya1989   answers by kaivalya1989

Showing Answers 1 - 3 of 3 Answers

The function comp() can be used for compression.The compression logic for comp() should provide the fact that ASCII only uses the bottom (least significant) seven bits of an 8-bit byte. The compression logic should simply squeeze out the 8th bit.

Algorithm:The program should consider the output to be a stream of bits and the 7 data bits from each input byte should simply be sent to the output bit stream, with the 8th bit being discarded. The 7 data bits should be sent to the output stream in order of increasing significance, bit 0 (least significant) first, bit 1 next, and so on.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions