C++内嵌代码使用压缩的方法(compress和uncompress函数)需要有zlib,编译时加-lz
转自:http://blogold.chinaunix.net/u3/118848/showart_2363489.html以下全文转:
使用zlib库里的compress函数与uncompress函数
zlib 是通用的压缩库,提供了一套 in-memory 压缩和解压函数,并能检测解压出来的数据的完整性(integrity)。zlib 也支持读写 gzip (.gz) 格式的文件。下面介绍两个最有用的函数——compress 和 uncompress。
<div style="padding-bottom: 1pt; padding-left: 4pt; padding-right: 4pt; padding-top: 1pt;">int compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen);
页:
[1]