Compression and Decompression

As I have learned in the C++ source file, the lines have to start with many leading spaces. To save spaces in the saving file (to compress the file), the leading spaces may be counted and store the count as an integer in the beginning of the line followed by the rest of the characters of the line.

Example: Assume two ASCII characters are reserved for the integer count.

Source file: source.txt
No leading spaces on line 1
Five leading spaces on line 2
Fourteen leading spaces on line 3
Two leading spaces on line 4

Compressed file: source.zip

0No leading space on line 1
5Five leading spaces on line 2
14Fourteen leading spaces on line 3
2Two leading spaces on line 4

Write a C++ program to compress a C++ source file, store the compressed file in source.zip, and output to the monitor screen the number of space characters eliminated from the original source file. Assuming that the number of spaces are less than 99, reserve two ASCII characters to store the count.

Write a C++ program to uncompress the zip. File previously compressed and store the uncompressed file in source.rcv

Note: source.txt and source.rcv must look the same.