gzipdemo.cpp
来自「数据压缩源代码和VC中使用DEMO」· C++ 代码 · 共 23 行
CPP
23 行
// gzipdemo.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "../GZipHelper.h"
int _tmain(int argc, _TCHAR* argv[])
{
char plainText[]="Plain text here";
CA2GZIP gzip(plainText,strlen(plainText)); // do compressing here;
LPGZIP pgzip=gzip.pgzip; // pgzip is zipped data pointer, you can use it irectly
int len=gzip.Length; // Length is length of zipped data;
CGZIP2A plain(pgzip,len); // do uncompressing here
char *pplain=plain.psz; // psz is plain data pointer
int aLen=plain.Length; // Length is length of unzipped data.
printf("Size=%i %s",aLen,pplain);
int X;
scanf("%d",&X);
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?