tags:

views:

178

answers:

5
+1  Q: 

compressing a file

how can i compress a file in c/c++.i want to devlop application like winzip/winrar. A simpler one

+1  A: 

Quick, simple, and easy to use ZIP compression utilities for C++:

Zip Utils - clean, elegant, simple, C++/Win32

djzmo
+2  A: 

You could give Huffman coding a try. Implementing Huffman coding is a pretty standard assignment in many CS programs.

From Wikipedia.

In computer science and information theory, Huffman coding is an entropy encoding algorithm used for lossless data compression. The term refers to the use of a variable-length code table for encoding a source symbol (such as a character in a file) where the variable-length code table has been derived in a particular way based on the estimated probability of occurrence for each possible value of the source symbol. It was developed by David A. Huffman while he was a Ph.D. student at MIT, and published in the 1952 paper "A Method for the Construction of Minimum-Redundancy Codes".

Kyle Walsh
+6  A: 

Take a look at zlib.

zooropa
A: 

Take a look at gzip and bzip2. Both of these are widely used file compression algorithms that compress better than .zip does, however both of them are usually used only to compress a single file. In order to create archives, both gzip and bzip2 rely on a separate tar application.

If you would write a single application that could manage an archive containing gzipped/bzip2ed files, like winzip, that would indeed be simpler than raw gzip/bzip2.

Michael Dillon
A: 

You know FUSE, file system to navigate, extract, create and modify ZIP archives based in libzip implemented in C++.

lsalamon