当前位置: 首页 > news >正文

做网站还要什么认证吗加盟培训机构

做网站还要什么认证吗,加盟培训机构,南京网络推广网站,工作人员否认陈道明演庆余年2前言 新建项目:pro文件中新增代码 LIBS -lz 在main.cpp函数中#include "zlib.h",如果此时运行代码提示没有找到对应的函数,那么就qt安装目录:D:\C\qt5.12.7\Tools\mingw730_64\x86_64-w64-mingw32\include(这里是博主…

前言

 新建项目:pro文件中新增代码

LIBS+= -lz

在main.cpp函数中#include "zlib.h",如果此时运行代码提示没有找到对应的函数,那么就qt安装目录:D:\C++\qt5.12.7\Tools\mingw730_64\x86_64-w64-mingw32\include(这里是博主的路径,作为参考找自己的路径)下查看是否有zlib.h头文件,复制这个文件到当前目录下即可运行

数据流压缩解压缩


#include "zlib.h"
#include <zlib.h>int main(int argc,char * argv[])
{
//    QApplication a(argc, argv);char text[] = "zlib compress and uncompress test\nturingo@163.com\n2012-11-05\n";uLong tlen = strlen(text) + 1;	/* 需要把字符串的结束符'\0'也一并处理 */char* buf = NULL;uLong blen;cout <<"start: tlen = "<< tlen << endl;/* 计算缓冲区大小,并为其分配内存 */blen = compressBound(tlen);	/* 压缩后的长度是不会超过blen的 */if((buf = (char*)malloc(sizeof(char) * blen)) == NULL){printf("no enough memory!\n");return -1;}cout << "compressBound: blen =  " << blen<< endl;
//        /* 压缩 */if(compress((Bytef*)buf, &blen,(Bytef*) text, tlen) != Z_OK){printf("compress failed!\n");return -1;}cout <<"compress \n";cout << strlen(buf)+1 << endl;cout <<"uncompress \n";/* 解压缩 */if(uncompress((Bytef*)text, &tlen, (Bytef*)buf, blen) != Z_OK){printf("uncompress failed!\n");return -1;}/* 打印结果,并释放内存 */printf("%s", text);if(buf != NULL){free(buf);buf = NULL;}//    return a.exec();return 0;
}
   char text[] = "zlib testddsa ";uLong tlen = strlen(text) + 1;	/* 需要把字符串的结束符'\0'也一并处理 */char* buf = NULL;uLong blen;cout <<"start: tlen = "<< tlen << endl;/* 计算缓冲区大小,并为其分配内存 */blen = compressBound(tlen);	/* 压缩后的长度是不会超过blen的 */if((buf = (char*)malloc(sizeof(char) * blen)) == NULL){printf("no enough memory!\n");return -1;}cout << "blen = " << blen<< endl;compress((Bytef*)buf,&blen,(Bytef*)text,tlen);cout << "blen = "<< blen<< endl;cout << "strlen(buf) = " << strlen(buf)<< endl;uLong ubound = compressBound(strlen(buf)+1 );/* 压缩后的长度是不会超过blen的 */cout << "bound =" << ubound<< endl;uncompress((Bytef*)text,&ubound,(Bytef*)buf,blen);cout << "unbound =" << ubound<< endl;

文件压缩解压缩

        uLong blen,tlen;char text[1024];char* dest;FILE* f,ff;
//        f = fopen("test.txt","r+");//        fread(text,1,1024,f);
//        tlen = strlen(text)+1;
//        cout << text << endl;
//        cout << "tlen = "<< tlen  << endl;//        blen = compressBound(tlen);
//        cout << "blen = "<< blen  << endl;//        dest = (char *)malloc(blen );
//        compress((Bytef*)dest,&blen,(Bytef*)text,tlen);//        cout << "blen = "<< blen  << endl;
//        ff = fopen("test.aaa","w");
//        fwrite(dest,blen,1,ff);
//        fclose(ff);
//        fclose(f);f= fopen("test.aaa","r+");fread(dest,1024,1,f);fclose(f);
//            cout << dest << endl;blen = compressBound(strlen(dest)+1);uncompress((Bytef*)text,&blen,(Bytef*)dest,1024);cout << text << endl;

http://www.hkea.cn/news/724829/

相关文章:

  • 自己做的网站能放到网上么青岛seo经理
  • 营业推广策划方案邵阳网站seo
  • 手机网站横向切换kol合作推广
  • 专门做超市海报的网站宁波seo咨询
  • 仿网站上的焦点图在线看seo网站
  • 做网站的业务员艾滋病阻断药有哪些
  • web集团网站建设广告投放平台有哪些
  • 大连做网站建设广告资源对接平台
  • 做网站怎么写工作日志泉州网站seo公司
  • wordpress外链站内打开搜索引擎是什么意思啊
  • 做论坛网站需要什么备案新站seo优化快速上排名
  • 动漫网站html百度网盘搜索
  • 怎么看一个网站什么语言做的宝鸡seo培训
  • 数据库网站建设公司他达拉非片
  • 英文商城网站建设搜索引擎营销的特点
  • 易优建站系统图片百度搜索
  • 网站开发不用框架web网站设计
  • 技能网站建设项目需求武汉网络推广外包公司
  • 安卓市场下载手机版优化网站排名技巧
  • 建设网站平台哪个好互联网营销外包推广
  • 工商注册企业名称查询广东seo网站推广代运营
  • 中纪委网站两学一做征文资源平台
  • java高端网站建设现在广告行业好做吗
  • wordpress 制作下载优化关键词怎么做
  • 宁波网站建设哪个公司好百度爱采购推广怎么入驻
  • 重庆市建设工程信息网特种作业企业网站seo多少钱
  • 域名备案做电影网站制作免费个人网站
  • 公司网络营销方案优化设计七年级上册数学答案
  • 网站建设策划方案网址搜索引擎
  • 艺术培训学校系统网站怎么做百度优化是什么