#include"Compress.h"
#include
#include
#include
using namespace std;
bool readFile(const char *fileName);
int main(){
bool ReadFile(char *fileName);
cout<<"=======Huffman文件压缩======"<
cout
char fileName[256];
cin>>fileName;
Compress(fileName);
bool ReadFile(char *fileName){
int weight[256]; //记录各字节重复次数
char ch;
ifstream in;
in.open(fileName);//以二进制流方式读取文件
while((ch=getc(in))!=EOF) //扫描文件 获得权重
weight[ch]++;
fclose(in); //关闭文件
return true;
}
int outputWeight(){
cout<<"Byte"<<"Weight"<<endl;
for(int i=0;i<256;I++)
printf("Ox%O2X %d",i,weight[i]);
return 0;
}
return 0;
}