#include
#include
#include
#include
#include
#include
int main(int argc, char **argv)
{
gzFile mygzfp;
FILE *fd, *fd1;
int i;
float obj[3600];
unsigned char buf[3600*5];
unsigned long len=3600*5;
fd = fopen("test", "r");
fd1 = fopen("test.zip", "w");
for(i=0;i<3600;i++) {
fread(&obj[i], sizeof(float), 1, fd);
}
compress(buf, &len, (unsigned char *)&obj[0], 3600*sizeof(float));
fwrite(buf, sizeof(char), len, fd1);
fclose(fd);
fclose(fd1);
return 0;
}
阅读(1889) | 评论(0) | 转发(0) |